Skip to content

Commit

Permalink
SNOW-1646711 Raise warning whenever MultiIndex is pulled in locally (#…
Browse files Browse the repository at this point in the history
…2258)

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

   Fixes SNOW-1646711

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
   - [x] 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.

Raise a warning whenever a method pulls in a MultiIndex locally - this
happens only once.

---------

Co-authored-by: Doris Lee <[email protected]>
  • Loading branch information
sfc-gh-vbudati and sfc-gh-dolee authored Sep 10, 2024
1 parent 2eb2a2a commit a03da97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
- Create a lazy index from another lazy index without pulling data to client.
- Raised `NotImplementedError` for Index bitwise operators.
- Display a clearer error message when `Index.names` is set to a non-like-like object.
- Raise a warning whenever MultiIndex values are pulled in locally.

#### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,9 @@ def index(self) -> Union["pd.Index", native_pd.MultiIndex]:
"""
if self.is_multiindex():
# Lazy multiindex is not supported
logging.warning(
"Lazy MultiIndex is not supported. MultiIndex values are evaluated eagerly and pulled out of Snowflake."
)
return self._modin_frame.index_columns_pandas_index()
else:
return pd.Index(query_compiler=self)
Expand Down

0 comments on commit a03da97

Please sign in to comment.