-
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-1642293 Add support for lazy index labels in reindex and fix reindex name bug #2175
Conversation
…wflakedb/snowpark-python into vbudati/SNOW-1642293-fix-reindex-bug
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.
Next, let's make reindex
can accept lazy index as labels
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 -- would it be possible to set the name field in the Index class as well when initialized in this PR (since you're already fixing the name bug)? To work around this: https://github.com/snowflakedb/snowpark-python/blob/main/src/snowflake/snowpark/modin/plugin/extensions/index.py#L269-L271
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'll take a pass on the combined version.
src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py
Outdated
Show resolved
Hide resolved
src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py
Outdated
Show resolved
Hide resolved
query_count = 2 | ||
join_count = 2 | ||
with SqlCounter(query_count=query_count, join_count=join_count): | ||
with SqlCounter(query_count=2 if limit is None else 3, join_count=2): |
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.
add a todo for fixing limit once @sfc-gh-rdurrani 's is monotonic PR is done
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.
query count is still the same, so no changes required.
src/snowflake/snowpark/modin/plugin/compiler/snowflake_query_compiler.py
Show resolved
Hide resolved
Co-authored-by: Andong Zhan <[email protected]>
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1642293
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Added support for using lazy index labels with reindex.
reindex
has a bug - if it is performed with an indexidx
which has a name, it does not update the result series'/df's index name accordingly. The name remains None.For instance,
Index
objects name was not set correctly during binary operations.