Skip to content
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

fix(python): ChainedWhen should not inherit Expr #17142

Merged
merged 2 commits into from
Jun 23, 2024

Conversation

eitsupi
Copy link
Contributor

@eitsupi eitsupi commented Jun 23, 2024

Perhaps it was a miss copy that was confused with Then or ChainedThen.

>>> import polars as pl
>>> pl.when(True).then(1).when(True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vscode/.local/lib/python3.9/site-packages/polars/expr/expr.py", line 137, in __repr__
    if len(expr_str := self._pyexpr.to_str()) > 30:
AttributeError: 'NoneType' object has no attribute 'to_str'

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Jun 23, 2024
Copy link

codecov bot commented Jun 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.87%. Comparing base (3444f64) to head (c157365).
Report is 4 commits behind head on main.

Current head c157365 differs from pull request most recent head 2c318e3

Please upload reports for the commit 2c318e3 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17142      +/-   ##
==========================================
- Coverage   80.88%   80.87%   -0.02%     
==========================================
  Files        1456     1456              
  Lines      191333   191333              
  Branches     2742     2742              
==========================================
- Hits       154757   154732      -25     
- Misses      36067    36092      +25     
  Partials      509      509              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Thanks, you're right! My mistake.

Thanks for noticing and opening a PR.

@stinodego stinodego changed the title fix(python): ChainedWhen should not inherit Expr fix(python): ChainedWhen should not inherit Expr Jun 23, 2024
@stinodego stinodego merged commit 6f3c68b into pola-rs:main Jun 23, 2024
13 of 14 checks passed
@eitsupi eitsupi deleted the chainedwhen-inherit branch June 23, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants