Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporal: Fixed ruff errors in t.list #5063

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arohanajit
Copy link
Contributor

Fixed ruff errors regarding path and context manager

@neteler neteler changed the title temporal: Fixed ruff errors in tlist/ temporal: Fixed ruff errors in t.list Feb 7, 2025
@github-actions github-actions bot added vector Related to vector data processing temporal Related to temporal data processing Python Related code is in Python module notebook labels Feb 7, 2025
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

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

This is probably not the best approach, you are doubling the amount of code, see the approach used in

with open(output, "w") if output != "-" else nullcontext(sys.stdout) as out_file:

@petrasovaa petrasovaa added this to the 8.5.0 milestone Feb 7, 2025
@echoix
Copy link
Member

echoix commented Feb 7, 2025

Yep, I agree with @petrasovaa here, I worked a bit to find that solution. The nullcontext is the appropriate choice for these situations, where sometimes a context manager is needed, but sometimes not, and you want to keep the "shape" of a context manager in both cases. See #4224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module notebook Python Related code is in Python temporal Related to temporal data processing vector Related to vector data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants