Skip to content
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-1649147]: Fix inplace argument for Series objects derived from DataFrames columns #2209

Closed
wants to merge 2 commits into from

Conversation

sfc-gh-rdurrani
Copy link
Contributor

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1649147

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

@@ -2752,8 +2752,6 @@ def _update_inplace(self, new_query_compiler):
# Propagate changes back to parent so that column in dataframe had the same contents
if self._parent is not None:
if self._parent_axis == 0:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the else, because it doesn't seem like self._parent_axis can be anything other than 1?

In [2]: df = pd.DataFrame([[1, 2, 3], [4, None, 6]], columns=list("ABC"))

In [3]: df['B']._parent_axis
Out[3]: 0

In [4]: df.loc[1]._parent_axis
Out[4]: 0

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sfc-gh-joshi should we override this code? BTW, in indexing, we never use _parent_axis before.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In our code base, we never set _parent_axis = 1.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should leave it as-is. We don't use it, but upstream modin uses it in DataFrame._getitem_column (which we don't use since we use a different code path for indexing).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we now set _parent_axis=1 correctly: #2210

@sfc-gh-rdurrani sfc-gh-rdurrani added the NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs label Sep 3, 2024
Copy link
Contributor

@sfc-gh-helmeleegy sfc-gh-helmeleegy left a comment

Choose a reason for hiding this comment

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

LGTM.

@sfc-gh-rdurrani sfc-gh-rdurrani changed the title [SNOW-1649147]: Fix inplace argument for Series objects derived from DataFrames [SNOW-1649147]: Fix inplace argument for Series objects derived from DataFrames columns Sep 3, 2024
Copy link
Contributor

@sfc-gh-vbudati sfc-gh-vbudati left a comment

Choose a reason for hiding this comment

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

Thanks Rehan!

@sfc-gh-rdurrani sfc-gh-rdurrani marked this pull request as draft September 3, 2024 17:27
@sfc-gh-rdurrani
Copy link
Contributor Author

Fixed by #2210

@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs snowpark-pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants