-
Notifications
You must be signed in to change notification settings - Fork 150
SNOW-800922: Support DataFrame.query for single-level index. #3795
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
Merged
sfc-gh-mvashishtha
merged 7 commits into
main
from
mvashishtha/SNOW-800922/support-query-with-single-level-index
Sep 22, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
09c4b31
SNOW-800922: Support DataFrame.query for single-level index.
sfc-gh-mvashishtha 2151f47
Add __init__.py to solve import issue. Remove query from test_unsuppo…
sfc-gh-mvashishtha b05b59c
Merge branch 'main' into mvashishtha/SNOW-800922/support-query-with-s…
sfc-gh-mvashishtha d3d5416
Apply suggestions from code review
sfc-gh-mvashishtha 5d466ff
Respond to comments.
sfc-gh-mvashishtha 17379a2
Update CHANGELOG.md
sfc-gh-mvashishtha 86718bd
Merge branch 'main' into mvashishtha/SNOW-800922/support-query-with-s…
sfc-gh-mvashishtha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # | ||
| # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. | ||
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # | ||
| # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. | ||
| # | ||
|
|
||
| import pytest | ||
| import pandas as native_pd | ||
| from tests.integ.modin.utils import ( | ||
| create_test_dfs, | ||
| ) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def test_dfs(): | ||
| return create_test_dfs( | ||
| native_pd.DataFrame( | ||
| { | ||
| "CUSTOMER_KEY": [-10, -10, -5, 30, 0, 1, 25], | ||
| "ACCOUNT_BALANCE": [-101, -101, -51, 30, 0, 53, 105], | ||
| "MARKET_SEGMENT": [ | ||
| "AUTOMOBILE", | ||
| "AUTOMOBILE", | ||
| "FURNITURE", | ||
| "AUTOMOBILE", | ||
| "FURNITURE", | ||
| "MACHINERY", | ||
| "HOUSEHOLD", | ||
| ], | ||
| "PURCHASE COUNT": [1, 0, 5, 7, 9, 10, 0], | ||
| }, | ||
| index=["i0", "i1", "i2", "i3", "i4", "i5", "i6"], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def test_dfs_with_named_index(): | ||
| return create_test_dfs( | ||
| native_pd.DataFrame( | ||
| { | ||
| "CUSTOMER_KEY": [-10, -10, -5, 30, 0, 1, 25], | ||
| "ACCOUNT_BALANCE": [-101, -101, -51, 30, 0, 53, 105], | ||
| "MARKET_SEGMENT": [ | ||
| "AUTOMOBILE", | ||
| "AUTOMOBILE", | ||
| "FURNITURE", | ||
| "AUTOMOBILE", | ||
| "FURNITURE", | ||
| "MACHINERY", | ||
| "HOUSEHOLD", | ||
| ], | ||
| }, | ||
| index=native_pd.Index( | ||
| ["i0", "i1", "i2", "i3", "i4", "i5", "i6"], name="index_name" | ||
| ), | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def test_dfs_multiindex(): | ||
| return create_test_dfs( | ||
| native_pd.DataFrame( | ||
| { | ||
| "CUSTOMER_KEY": [-10, -10, -5, 30, 0, 1, 25], | ||
| "ACCOUNT_BALANCE": [-101, -101, -51, 30, 0, 53, 105], | ||
| "MARKET_SEGMENT": [ | ||
| "AUTOMOBILE", | ||
| "AUTOMOBILE", | ||
| "FURNITURE", | ||
| "AUTOMOBILE", | ||
| "FURNITURE", | ||
| "MACHINERY", | ||
| "HOUSEHOLD", | ||
| ], | ||
| }, | ||
| index=native_pd.MultiIndex.from_tuples( | ||
| [ | ||
| ("i00", "i01"), | ||
| ("i10", "i11"), | ||
| ("i20", "i21"), | ||
| ( | ||
| "i30", | ||
| "i31", | ||
| ), | ||
| ("i40", "i41"), | ||
| ("i50", "i51"), | ||
| ("i60", "i61"), | ||
| ], | ||
| names=["level_0_name", "level_1_name"], | ||
| ), | ||
| ) | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.