Skip to content

Commit

Permalink
REFACTOR: Revert "Call fast path for __getitem__ if not lazy" (#43)
Browse files Browse the repository at this point in the history
This reverts commit f90e518.

Neither @mvashishtha nor @vnlitvinov see how this helps performance.
  • Loading branch information
mvashishtha authored May 11, 2023
1 parent 1a4aecb commit dfa2746
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions modin/pandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3634,16 +3634,13 @@ def __getitem__(self, key):
BasePandasDataset
Located dataset.
"""
if not self._query_compiler.lazy_execution:
if len(self) == 0:
return self._default_to_pandas("__getitem__", key)
# fastpath for common case
if isinstance(key, str) and key in self._query_compiler.columns:
return self._getitem(key)
elif is_list_like(key) and all(
k in self._query_compiler.columns for k in key
):
return self._getitem(key)
if not self._query_compiler.lazy_execution and len(self) == 0:
return self._default_to_pandas("__getitem__", key)
# fastpath for common case
if isinstance(key, str) and key in self._query_compiler.columns:
return self._getitem(key)
elif is_list_like(key) and all(k in self._query_compiler.columns for k in key):
return self._getitem(key)
# see if we can slice the rows
# This lets us reuse code in pandas to error check
indexer = None
Expand Down

0 comments on commit dfa2746

Please sign in to comment.