Skip to content

GH-7: [Python] Fix invalid-context-manager error - #30

Merged
rok merged 237 commits into
add-pyarrow-stubsfrom
invalid-context-manager
Jul 24, 2025
Merged

rok merged 237 commits into
add-pyarrow-stubsfrom
invalid-context-manager

Conversation

@rok

@rok rok commented Jul 21, 2025

Copy link
Copy Markdown
Owner

Rationale for this change

Part of #5.

What changes are included in this PR?

Fixes the invalid-context-manager. This fixes test cases where e.g. FlightClient was being overwritten with object which caused it to not have required methods to be used as context manager.

Are these changes tested?

Yes, locally, type checking passes.

Are there any user-facing changes?

No.

ZhengYu, Xu and others added 30 commits December 21, 2022 14:17
The main problem was that these were annotated as instance methods rather than static/class methods, but I've added some detail, too.
Fix stubs for Table factory methods
fix: make fs.FileSystem.from_uri and hdfs.HadoopFileSystem.from_uri as classmethod

ghost commented Jul 21, 2025

Copy link
Copy Markdown

⚠️ GitHub issue #7 has been automatically assigned in GitHub to PR creator.

ghost commented Jul 21, 2025

Copy link
Copy Markdown

⚠️ GitHub issue #7 has no components, please add labels for components.

@ghost ghost linked an issue Jul 22, 2025 that may be closed by this pull request
@ghost ghost changed the title GH-7 : [Python] Fix invalid-context-manager error GH-7: [Python] Fix invalid-context-manager error Jul 22, 2025

ghost commented Jul 22, 2025

Copy link
Copy Markdown

⚠️ GitHub issue #7 has no components, please add labels for components.

Base automatically changed from typing-ci to main July 24, 2025 15:08

ghost commented Jul 24, 2025

Copy link
Copy Markdown

⚠️ GitHub issue #7 has no components, please add labels for components.

@ghost
ghost force-pushed the main branch 3 times, most recently from 5354959 to 2cf52b4 Compare July 24, 2025 16:55
@ghost
ghost changed the base branch from main to add-pyarrow-stubs July 24, 2025 17:24

ghost commented Jul 24, 2025

Copy link
Copy Markdown

⚠️ GitHub issue #7 has no components, please add labels for components.

@ghost
ghost merged commit 76b8b5f into add-pyarrow-stubs Jul 24, 2025
@ghost
ghost deleted the invalid-context-manager branch July 24, 2025 17:30
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.

invalid-context-manager