modin-project / modin

Modin: Scale your Pandas workflows by changing a single line of code
http://modin.readthedocs.io
Apache License 2.0
9.59k stars 647 forks source link

Avoid unnecessary length checks in `df.squeeze` #7315

Open sfc-gh-dpetersohn opened 2 weeks ago

sfc-gh-dpetersohn commented 2 weeks ago

It is possible that when axis=1 in squeeze we still check len(self.index), which is never necessary when axis=1. Link to code here: https://github.com/modin-project/modin/blob/eac3c77baf456c7bd7e1e5fde81790a4ed3ebb27/modin/pandas/dataframe.py#L2074-L2084

This is an easy fix, also see https://github.com/snowflakedb/snowpark-python/pull/1767