Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

partition_unique leaks metadata references for completed and duplicate records

Offen
#501 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@harbinresearcher arbeitet bereits daran.

Seit 11.10.2026.

  • #502 von @harbinresearcher — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
backend, testing

Rechercherichtung

Start at partition_unique and inspect the shared retain/release helpers, then add regressions for keep="first", keep="last", and metadata shape. Verify discarded references are released immediately, synchronous completion leaves no references retained, and buffered downstream nodes keep references until processing finishes. An open pull request (#502) is already linked to this issue.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

partition_unique retains metadata references for every input, but does not release them when a duplicate is discarded (keep="first") or replaced (keep="last"). It also emits nested metadata lists, while the shared retain/release helpers expect a flat list of dictionaries. Even a completed partition with a synchronous sink leaves its references retained.

Reproduced on master 5267116f49fc2257e39b44abd8d1e5c5460715f8, Windows Python 3.12.14:

from streamz import Stream, RefCounter

for keep in ("first", "last"):
    source = Stream()
    output = source.partition_unique(2, keep=keep).sink_to_list()
    refs = [RefCounter() for _ in range(3)]
    for value, ref in zip((1, 1, 2), refs):
        source.emit(value, metadata=[{"ref": ref}])
    print(keep, output, [ref.count for ref in refs])

Actual: both modes output [(1, 2)] with counts [1, 1, 1]. Expected: [0, 0, 0] after the synchronous sink finishes; discarded records should release their references immediately. Buffered downstream nodes must still retain references until they finish processing.

I plan a narrow fix in partition_unique: release discarded metadata, flatten retained metadata for emission, and add first/last ownership and metadata-shape regressions. Searches found the original feature PR #389 but no current fix for this issue. Is there existing work or a preferred approach?

AI disclosure: this report and proposed contribution were prepared and reproduced by Codex under the account owner authorization. I am not claiming an active production use case or manual human review.

Vorherrschende Sprache
Python
Sterne
1.3k
Forks
150
Ø Merge
17 Std. 39 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python-streamz/streamz

Alle Issues in python-streamz/streamz

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.