Enhance typing with Self to support subclassing for multiple Python versions#1174
Open
mghotz wants to merge 1 commit intoarrow-py:masterfrom
Open
Enhance typing with Self to support subclassing for multiple Python versions#1174mghotz wants to merge 1 commit intoarrow-py:masterfrom
mghotz wants to merge 1 commit intoarrow-py:masterfrom
Conversation
jadchaar
requested changes
May 28, 2024
Member
jadchaar
left a comment
There was a problem hiding this comment.
Thanks for the contribution. Added a comment.
I also approved the workflow for a test run.
| if sys.version_info >= (3, 11): | ||
| from typing import Self | ||
| else: | ||
| from typing_extensions import Self |
Member
There was a problem hiding this comment.
Shouldn't this be added to requirements for 3.11 and below?
Member
There was a problem hiding this comment.
A recent PR was merged to remove typing extensions for 3.8 and below. Mind rebasing this CR against the change and updating the requirements.txt to only pull it in for 3.9 and 3.10
reference PR - #1176
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.
…ersions
Pull Request Checklist
Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:
toxormake testto find out!).tox -e lintormake lintto find out!).masterbranch.If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!
Description of Changes
This PR enhances type hints in the Arrow library by using Self to support subclassing, ensuring compatibility with both Python 3.11 and earlier versions. The following changes were made:
Testing:
All existing tests were run and passed successfully, ensuring no breaking changes were introduced.
Issue:
Fixes Issue #1168.
Please review and merge this PR to improve the code's robustness and maintainability.