Skip to content

TYP: ndim is consistently a property #47378

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

Merged
merged 4 commits into from
Jun 25, 2022
Merged

TYP: ndim is consistently a property #47378

merged 4 commits into from
Jun 25, 2022

Conversation

twoertwein
Copy link
Member

and _scalar_type

@mroeschke
Copy link
Member

Looks like this breaks some tests.

@@ -564,7 +564,7 @@ def test_shift_fill_int_deprecated(self):

expected = arr.copy()
if self.array_cls is PeriodArray:
fill_val = PeriodArray._scalar_type._from_ordinal(1, freq=arr.freq)
fill_val = arr._scalar_type._from_ordinal(1, freq=arr.freq)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was causing the error: when accessing a property on the class itself, you get the property object, not its content.

@mroeschke mroeschke added the Typing type annotations, mypy/pyright type checking label Jun 25, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jun 25, 2022
@mroeschke mroeschke merged commit 64ad019 into pandas-dev:main Jun 25, 2022
@mroeschke
Copy link
Member

Thanks @twoertwein

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* TYP: ndim is consistently a property

* unused import

* fix test

* nicer fix
@twoertwein twoertwein deleted the property branch September 21, 2022 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants