-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
TYP #37715: Fix mypy errors in column.py #50164
Conversation
@@ -81,7 +81,7 @@ def __init__(self, column: pd.Series, allow_copy: bool = True) -> None: | |||
self._col = column | |||
self._allow_copy = allow_copy | |||
|
|||
def size(self) -> int: # type: ignore[override] | |||
def size(self) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add the @property
decorator to get this to work with mypy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it in my first commit, but the tests failed, so I tried removing @Property
Huh strange - I guess that's why this was ignored before. That said, I think the property decorator is correct, at least according to the dataframe protocol https://data-apis.org/dataframe-protocol/latest/API.html So I think you can update the tests and add a whatsnew note describing this as a bug fix |
Hmm, the documentation seems to be not up to date. This was originally a property, but changed to a method a while ago (data-apis/dataframe-api#74 (comment)), so the currently implementation here is actually correct. |
Thanks for the pull request, but I believe this was addressed and fixed in #50565 so closing. Happy to have your contributions on any other typing issues! |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.