Reset _closeables in _init for flow reuse [1.10.x]#599
Merged
gtopper merged 1 commit intomlrun:1.10.xfrom Dec 21, 2025
Merged
Conversation
* Reset _closeables in _init for flow reuse * Add unit tests for _closeables reset in _init for flow reuse Tests verify that _closeables is properly reset when flows are reused: - test_flow_reuse_resets_closeables: Base Flow class resets to [] - test_aggregate_by_key_reuse_resets_closeables: AggregateByKey sets [table] - test_map_with_state_reuse_resets_closeables: MapWithState sets [state] for Table - test_map_with_state_no_closeables_without_close_method: No closeables for dict state - test_nosql_target_reuse_resets_closeables: NoSqlTarget sets [table] * Fix unit tests to properly detect ML-11518 bug and add clarifying comments Updated tests to check source._closeables instead of downstream step's _closeables, as the bug manifests in upstream steps. Added comments clarifying which tests detect the ML-11518 regression (3 tests) vs baseline/edge case tests (2 tests). Verified: - 3 tests FAIL on commit 74fec1a (before fix) - correctly detecting bug - All 5 tests PASS on commit 321dfec (with fix) and current branch * Simplify ML-11518 regression tests based on code review - Replace dynamic closeables tracking with direct assertions - Add try/finally blocks to prevent test hangs on failure - Remove PR-specific docstring notes that don't apply post-merge - Move AggregateByKey test to test_aggregate_by_key.py --------- Co-authored-by: Alex Toker <alext@mckinsey.com>
gtopper
approved these changes
Dec 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #597