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-1478924]: Ensure __getitem__ on DataFrameGroupBy returns SeriesGroupBy when appropriate even if as_index=False #2475

Merged
merged 5 commits into from
Oct 18, 2024

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-1478924

  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.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
  3. Please describe how your code solves the related issue.

Ensure that getitem on a DataFrameGroupBy returns a SeriesGroupBy if only one column is indexed, even if as_index=False.

…esGroupBy when appropriate even if `as_index=False`
@sfc-gh-rdurrani sfc-gh-rdurrani added the NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs label Oct 18, 2024
Copy link
Contributor

@sfc-gh-nkrishna sfc-gh-nkrishna left a comment

Choose a reason for hiding this comment

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

Can we add tests for this?

@sfc-gh-rdurrani
Copy link
Contributor Author

Can we add tests for this?

I think there are already tests for this? Because in a lot of the groupby tests, we have a getitem test, so that checks that this works correctly. Would you like me to add some tests that check the types of SeriesGroupBy vs. DataFrameGroupBy?

@sfc-gh-rdurrani sfc-gh-rdurrani enabled auto-merge (squash) October 18, 2024 18:29
@sfc-gh-nkrishna
Copy link
Contributor

Can we add tests for this?

I think there are already tests for this? Because in a lot of the groupby tests, we have a getitem test, so that checks that this works correctly. Would you like me to add some tests that check the types of SeriesGroupBy vs. DataFrameGroupBy?

Yeah in general I think it would be helpful to have an associated test (an isinstance check sounds good to me) whenever there is a bug fix

Copy link
Contributor

@sfc-gh-nkrishna sfc-gh-nkrishna left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@sfc-gh-lmukhopadhyay sfc-gh-lmukhopadhyay left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Nice! Thanks, Rehan.

@sfc-gh-rdurrani sfc-gh-rdurrani merged commit afa7d7d into main Oct 18, 2024
36 checks passed
@sfc-gh-rdurrani sfc-gh-rdurrani deleted the rdurrani-SNOW-1478924 branch October 18, 2024 20:17
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 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.

4 participants