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

depr(python): Deprecate LazyFrame.with_context in favor of horizontal concatenation #16860

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Jun 10, 2024

Changes

  • Deprecate LazyFrame.with_context. Users should use pl.concat(..., how="horizontal") instead.

Example

Before

>>> lf1 = pl.LazyFrame({"a": [1, 2, 3]})
>>> lf2 = pl.LazyFrame({"b": [4, 5, 6]})
>>> lf1.with_context(lf2).select(pl.col("a") + pl.col("b").first()).collect()
shape: (3, 1)
┌─────┐
│ a   │
│ --- │
│ i64 │
╞═════╡
│ 5   │
│ 6   │
│ 7   │
└─────┘

After

>>> pl.concat([lf1, lf2], how="horizontal").select(pl.col("a") + pl.col("b").first()).collect()
shape: (3, 1)
┌─────┐
│ a   │
│ --- │
│ i64 │
╞═════╡
│ 5   │
│ 6   │
│ 7   │
└─────┘

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.34%. Comparing base (3fe4cfe) to head (e921030).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16860      +/-   ##
==========================================
- Coverage   81.37%   81.34%   -0.03%     
==========================================
  Files        1425     1425              
  Lines      187669   187868     +199     
  Branches     2702     2703       +1     
==========================================
+ Hits       152720   152829     +109     
- Misses      34453    34543      +90     
  Partials      496      496              

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

@ritchie46 ritchie46 merged commit 1a2707d into main Jun 11, 2024
15 checks passed
@ritchie46 ritchie46 deleted the depr-with-context branch June 11, 2024 06:16
@stinodego stinodego changed the title depr(python): Deprecate LazyFrame.with_context depr(python): Deprecate LazyFrame.with_context in favor of horizontal concatenation Jun 12, 2024
@c-peters c-peters added the accepted Ready for implementation label Jun 16, 2024
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation deprecation Add a deprecation warning to outdated functionality python Related to Python Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants