-
-
Notifications
You must be signed in to change notification settings - Fork 145
Improve results of stubtest #1286
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
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good to me, but I'm a bit unsure about the deprecated arguments.
@@ -1579,6 +1584,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||
periods: int = ..., | |||
fill_method: None = ..., | |||
freq: DateOffset | timedelta | _str | None = ..., | |||
limit: int | None = ..., # deprecated since 2.1 |
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.
not sure if we want to add a deprecated argument. If we add it, we could add it with just its default value limit: None
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.
we shouldn't add deprecated arguments. so remove this
@@ -14,5 +15,9 @@ def read_parquet( | |||
engine: ParquetEngine = ..., | |||
columns: list[str] | None = ..., | |||
storage_options: StorageOptions = ..., | |||
use_nullable_dtypes: bool = ..., # deprecated since 2.0 |
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.
can probably be removed
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.
YEs, I agree. Should remove.
Thanks @twoertwein for the review, I was debating myself about the deprecated args, they appear in the stubtest since the code is still there. |
@@ -1132,6 +1135,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||
freq: DateOffset | timedelta | _str | None = ..., | |||
axis: Axis = ..., | |||
fill_value: Scalar | NAType | None = ..., | |||
suffix: _str | None = ..., # has no effect at the moment |
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.
Probably should split into 2 overloads, based on the docs. One is where periods
is int
and there is no suffix
argument, and the other where periods
is Sequence[int]
and then suffix
is allowed.
I don't understand what you mean by "has no effect at the moment"
@@ -1217,7 +1222,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||
def droplevel(self, level: Level | list[Level], axis: AxisIndex = ...) -> Self: ... | |||
def pop(self, item: Hashable) -> S1: ... | |||
@final | |||
def squeeze(self) -> Series[S1] | Scalar: ... | |||
def squeeze(self, axis: Axis = ...) -> Series[S1] | Scalar: ... |
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.
def squeeze(self, axis: Axis = ...) -> Series[S1] | Scalar: ... | |
def squeeze(self, axis: None = ...) -> Series[S1] | Scalar: ... |
The only valid value here is None
for axis
@@ -1579,6 +1584,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||
periods: int = ..., | |||
fill_method: None = ..., | |||
freq: DateOffset | timedelta | _str | None = ..., | |||
limit: int | None = ..., # deprecated since 2.1 |
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.
we shouldn't add deprecated arguments. so remove this
@@ -14,5 +15,9 @@ def read_parquet( | |||
engine: ParquetEngine = ..., | |||
columns: list[str] | None = ..., | |||
storage_options: StorageOptions = ..., | |||
use_nullable_dtypes: bool = ..., # deprecated since 2.0 |
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.
YEs, I agree. Should remove.
I prefer to not have deprecated arguments in the stubs, because we want people to stop using them. Maybe there is a way to tell |
Clean up some old pandas 2.2 code that was removed, improved the results of the stubtest.
assert_type()
to assert the type of any return value