-
Notifications
You must be signed in to change notification settings - Fork 121
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
chore: simplify definitions of rhs expressions, bump dask minimum to 2024.10 #1720
Conversation
def extract_compliant(expr: Expr, other: Any) -> Any: | ||
def extract_compliant( | ||
plx: CompliantNamespace[CompliantSeriesT_co], other: Any | ||
) -> CompliantExpr[CompliantSeriesT_co] | CompliantSeriesT_co | Any: |
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.
lol the annotations weren't right to begin with here 😄
other = extract_compliant(self, other) | ||
return self.__class__(lambda plx: self._to_compliant_expr(plx).is_in(other)) | ||
return self.__class__( | ||
lambda plx: self._to_compliant_expr(plx).is_in( | ||
extract_compliant(plx, other) | ||
) | ||
) |
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.
this wasn't quite right to begin with (plx
should be passed to extract_compliant
, not self
) - mypy helped detect it 😍
8e013f1
to
89597a0
Compare
python-version: ["3.9", "3.11", "3.13"] | ||
python-version: ["3.11", "3.13"] |
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.
we've already got other jobs testing 3.9 (like the "random versions" one)
request: pytest.FixtureRequest, | ||
) -> None: | ||
if "dask_lazy_p2" in str(constructor) and "lit_with_agg" in col_name: | ||
request.applymarker(pytest.mark.xfail) |
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.
feels nice to accidentally fix a bug with a refactor 😎
This was quite satisfying 😋 I'm tired of reimplementing right-hand-side arithmetic for each backend, I think we can just do it at the
narwhals.Expr
levelWhat type of PR is this? (check all applicable)
Related issues
Checklist
If you have comments or can explain your changes, please do so below