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

docs(python): Add a note about the behaviour of lower/upper bounds for is_between, and add an example #15197

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Mar 20, 2024

Closes #15185.

Our is_between functionality is correct, and consistent with other implementations (see the equivalent BETWEEN keyword in SQL1 for an example of this), but we can better document the behaviour when lower_bound > upper_bound.

  • Added a "Notes" section and a new example that includes this case.

Footnotes

  1. https://www.postgresql.org/docs/current/functions-comparison.html#FUNCTIONS-COMPARISON-PRED-TABLE

@github-actions github-actions bot added documentation Improvements or additions to documentation python Related to Python Polars labels Mar 20, 2024
@alexander-beedie alexander-beedie force-pushed the isbetween-example-and-docstring-note branch from 1de4791 to c084e6a Compare March 20, 2024 19:10
Copy link
Collaborator

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

nice!

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.22%. Comparing base (4656342) to head (c084e6a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15197      +/-   ##
==========================================
- Coverage   81.22%   81.22%   -0.01%     
==========================================
  Files        1348     1348              
  Lines      175333   175333              
  Branches     2508     2508              
==========================================
- Hits       142420   142409      -11     
- Misses      32433    32444      +11     
  Partials      480      480              

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

@stinodego stinodego merged commit 02b3157 into pola-rs:main Mar 20, 2024
19 checks passed
@alexander-beedie alexander-beedie deleted the isbetween-example-and-docstring-note branch March 20, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsorted positional inputs to pl.Expr.is_between should be sorted or raise an error
3 participants