Skip to content

Polish Polars support and add bootstrap CI test coverage#921

Merged
jeongyoonlee merged 1 commit into
uber:masterfrom
aman-coder03:fix/polars-followups
Jul 1, 2026
Merged

Polish Polars support and add bootstrap CI test coverage#921
jeongyoonlee merged 1 commit into
uber:masterfrom
aman-coder03:fix/polars-followups

Conversation

@aman-coder03

Copy link
Copy Markdown
Contributor

Proposed changes

this PR addresses the follow-ups from the native Polars support work in #901

it includes a small performance cleanup in the S-learner, simplifies the X-learner implementation by reusing existing NumPy arrays, replaces the hardcoded test seed with the shared constant, and adds regression tests covering the store_bootstraps=True -> predict(return_ci=True) path for DataFrame inputs, along with additional Polars test coverage for the DR classifier

closes #920

Types of changes

What types of changes does your code introduce to CausalML?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc. This PR template is adopted from appium.

@jeongyoonlee jeongyoonlee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @aman-coder03 — this cleanly closes out all four #920 follow-ups. Verified locally with polars installed: tests/test_polars_support.py 38 passed (incl. the new test_bootstrap_ci_dataframe over pandas+polars and TestDRClassifierPolars), and the S/X-learner + bootstrap/return_ci regression in tests/test_meta_learners.py still passes, so the hoist and the y_filt_np[w == 1] switch are safe.

Approving. One trivial, non-blocking nit for whenever you're next in the file: in slearner.py the "Build separate frames … CatBoost sets the writeable flag to False …" comment now sits inside the loop while the X_new_c/X_new_t construction it describes moved above it — worth moving the comment up with the construction so it documents the right lines. Not worth holding the merge.

@jeongyoonlee jeongyoonlee merged commit 5c9167d into uber:master Jul 1, 2026
7 checks passed
@jeongyoonlee jeongyoonlee mentioned this pull request Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Polars support (#901) follow-ups: non-blocking polish + bootstrap CI test coverage

2 participants