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

Fix override issue in GeoDataFrame.astype return type #13606

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

Daksh2000
Copy link
Contributor

@Daksh2000 Daksh2000 commented Mar 9, 2025

Issue - #13603
This fixes mypy error in CI workflows.

Copy link
Contributor

github-actions bot commented Mar 9, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

I don't know enough about (geo)pandas, and it's not particularly easy to find the implementation in the documentation of either, but considering that pd.DataFrame.astype's repr output indicates that it should return Self (and that GeoDataFrame seems to override astype so who knows what it returns), this return type seems fine.

@srittau srittau merged commit 59717f4 into python:main Mar 9, 2025
43 checks passed
@Daksh2000
Copy link
Contributor Author

Daksh2000 commented Mar 9, 2025

I don't know enough about (geo)pandas, and it's not particularly easy to find the implementation in the documentation of either, but considering that pd.DataFrame.astype's repr output indicates that it should return Self (and that GeoDataFrame seems to override astype so who knows what it returns), this return type seems fine.

Yes, even I went for this fix as per the doc
https://github.com/pandas-dev/pandas/blob/v2.2.3/pandas/core/generic.py#L6463-L6660

Thank you @srittau !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants