Skip to content

[ntuple] Add ctx manager to RNTupleReader and update RNTupleWriter's#21131

Merged
silverweed merged 1 commit intoroot-project:masterfrom
silverweed:rntuplereader_close_py
Feb 26, 2026
Merged

[ntuple] Add ctx manager to RNTupleReader and update RNTupleWriter's#21131
silverweed merged 1 commit intoroot-project:masterfrom
silverweed:rntuplereader_close_py

Conversation

@silverweed
Copy link
Contributor

@silverweed silverweed commented Feb 3, 2026

Now both the Reader and Writer's context objects will close the underlying file upon __exit__. The object will raise an exception if accessed after the with statement.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Test Results

    22 files      22 suites   3d 11h 30m 53s ⏱️
 3 795 tests  3 790 ✅ 0 💤 5 ❌
76 350 runs  76 345 ✅ 0 💤 5 ❌

For more details on these failures, see this check.

Results for commit f3d5b2e.

♻️ This comment has been updated with latest results.

@silverweed silverweed mentioned this pull request Feb 4, 2026
2 tasks
@silverweed silverweed force-pushed the rntuplereader_close_py branch 2 times, most recently from a9b7af0 to b1b0ce6 Compare February 6, 2026 16:05
Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but should be approved by @vepadulano or @guitargeek

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! A few more questions/comments

@silverweed silverweed force-pushed the rntuplereader_close_py branch from b1b0ce6 to b5f20f8 Compare February 12, 2026 09:37
Now both the Reader and Writer's context objects will close the underlying
file upon __exit__. The object will raise an exception if accessed after
the `with` statement.
@silverweed silverweed force-pushed the rntuplereader_close_py branch from eada079 to f3d5b2e Compare February 24, 2026 10:08
Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM once tests pass.

@silverweed silverweed merged commit 6c57df7 into root-project:master Feb 26, 2026
26 of 30 checks passed
@silverweed silverweed deleted the rntuplereader_close_py branch February 26, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants