-
Notifications
You must be signed in to change notification settings - Fork 116
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
SNOW-1063347: Remove series.py #2205
Conversation
293f95a
to
e18d646
Compare
be2b26c
to
72cb1ca
Compare
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.
LGTM, thanks!!
@@ -1491,7 +1491,7 @@ def iloc(): | |||
With a scalar integer. | |||
|
|||
>>> type(df.iloc[0]) | |||
<class 'snowflake.snowpark.modin.pandas.series.Series'> | |||
<class 'modin.pandas.series.Series'> |
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 felt little bit wired to have test shown the whole class path in the example, is that the only place we have this? we can fix it like this for now, but maybe later we can have a separate pr to remove those in all examples
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.
A few other tests and docstrings (describe
, info
) do this; I'll do a more thorough pass in a later PR.
@@ -12352,6 +12382,18 @@ def _quantiles_single_col( | |||
|
|||
return SnowflakeQueryCompiler(internal_frame) | |||
|
|||
def mode( | |||
self, axis: Axis = 0, numeric_only: bool = False, dropna: bool = True |
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 those method not implemented error be at the overwritten part? instead of query compiler like how other apis works today
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 can move it to the frontend overrides, but if it is possible to push the error to the query compiler without changing existing behavior I think we should do so.
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.
API not implemented errors today are all thrown at frontend api layer, so let's keep it the same everywhere, if we decide to do those not implemented error at query_compiler layer, let's do it the same for all API also
src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py
Outdated
Show resolved
Hide resolved
|
||
For `Series` axis parameter is unused and defaults to 0. | ||
|
||
>>> ser.take([0, 3], axis=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.
why this is removed now?
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.
Silently accepting axis=1 didn't match pandas behavior. If we want to preserve the behavior of ignoring axis=1
, we'd have to add back an override stub for it, but I don't think it makes sense do keep.
>>> native_pd.Series([1]).take([0], axis=1)
Traceback (most recent call last):
File "/Users/joshi/miniconda3/envs/snowpandas-39/lib/python3.9/site-packages/pandas/core/generic.py", line 575, in _get_axis_number
return cls._AXIS_TO_AXIS_NUMBER[axis]
KeyError: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/joshi/miniconda3/envs/snowpandas-39/lib/python3.9/site-packages/pandas/core/generic.py", line 4132, in take
axis=self._get_block_manager_axis(axis),
File "/Users/joshi/miniconda3/envs/snowpandas-39/lib/python3.9/site-packages/pandas/core/generic.py", line 595, in _get_block_manager_axis
axis = cls._get_axis_number(axis)
File "/Users/joshi/miniconda3/envs/snowpandas-39/lib/python3.9/site-packages/pandas/core/generic.py", line 577, in _get_axis_number
raise ValueError(f"No axis named {axis} for object type {cls.__name__}")
ValueError: No axis named 1 for object type Series
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 see, do you know if it is a new behavior introduced in 2.2.* compare with 1.5.3
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, seems like it works in pandas 2.0.3 and fails in pandas 2.1.4.
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 you add a entry in the change log to indicate this difference?
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.
done
72cb1ca
to
3958304
Compare
d67310f
to
2f7406c
Compare
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.
@sfc-gh-joshi Thanks for taking care of the comment! Can you add one description in the changelog to indicate the change for take?
|
||
For `Series` axis parameter is unused and defaults to 0. | ||
|
||
>>> ser.take([0, 3], axis=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.
Can you add a entry in the change log to indicate this difference?
0325cb2
to
643f7b9
Compare
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1063347
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This PR removes series.py (following up #2167). As before, any preserved overrides are given a reason in code comments. The following methods have been added to
series_overrides.py
:Because of differences in
__getattr__
logic, we need to adddt
,str
, andcolumns
to_ATTRS_NO_LOOKUP
in this PR to prevent additional queries from being incurred. This will create slightly different behavior for attempting to access a named index element directly: