-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: add typing to dtype arg in selection of files in core/arrays (GH38808) #38826
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
CLN: add typing to dtype arg in selection of files in core/arrays (GH38808) #38826
Conversation
pandas/core/arrays/boolean.py
Outdated
@@ -273,7 +273,7 @@ def dtype(self) -> BooleanDtype: | |||
|
|||
@classmethod | |||
def _from_sequence( | |||
cls, scalars, *, dtype=None, copy: bool = False | |||
cls, scalars, *, dtype: Optional[DtypeArg] = None, copy: bool = False |
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.
most of these are Optional[Dtype} NOT DtypeArg (eg. only a single dtype and not a dict of them). The only things that take DtypeArg are things like astype and the I/O methods
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.
Changed it. I did it right last time, but I think I was a bit too quick with submitting this PR. Thanks for the review.
Some checks are failing, will look at it tomorrow. |
pandas/core/arrays/categorical.py
Outdated
@@ -1294,7 +1297,7 @@ def _validate_fill_value(self, fill_value): | |||
|
|||
# ------------------------------------------------------------- | |||
|
|||
def __array__(self, dtype=None) -> np.ndarray: | |||
def __array__(self, dtype: Optional[Dtype] = None) -> np.ndarray: |
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.
these should be NpDtype (this is a numpy protocol)
pandas/core/arrays/datetimelike.py
Outdated
@@ -265,7 +265,7 @@ def _formatter(self, boxed=False): | |||
# ---------------------------------------------------------------- | |||
# Array-Like / EA-Interface Methods | |||
|
|||
def __array__(self, dtype=None) -> np.ndarray: | |||
def __array__(self, dtype: Optional[Dtype] = None) -> np.ndarray: |
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.
same
lgtm ping on green |
thanks @avinashpancham |
Follow on PR for #38808
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff