Skip to content

Conversation

@rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Dec 20, 2025

Generalizes the expressions to handle:

  • properties and cached properties
  • __getitem__
  • qcut and where

In addition, it removes the unnecessary wrapping with parentheses.

main: ((col('a') + 1) * (col('b') + 1))
PR: (col('a') + 1) * (col('b') + 1)

Adding support for additional methods throughout pandas should be straightforward.

return self._func(df)

def _with_binary_op(self, op: str, other: Any) -> Expression:
def _with_op(self, op: str, other: Any) -> Expression:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed because we now use this for __getitem__ too.

@rhshadrach rhshadrach added Enhancement expressions pd.eval, query, pd.col labels Dec 20, 2025
@rhshadrach rhshadrach added this to the 3.0 milestone Dec 20, 2025
@rhshadrach rhshadrach marked this pull request as ready for review December 20, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement expressions pd.eval, query, pd.col

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Support expressions in pd.qcut

1 participant