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): Refactor is_between #5491

Merged
merged 1 commit into from
Nov 13, 2022

Conversation

zundertj
Copy link
Collaborator

* no special datetime handling, is not needed, the underlying operators handle that properly
* added date and float to the type annotation. Closes pola-rs#5489
* add tests on the four data types allowed as input types
@zundertj zundertj changed the title Refactor is_between fix(python): Refactor is_between Nov 12, 2022
@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Nov 12, 2022
@thomasaarholt
Copy link
Contributor

Nice! I think you can omit the int in the type hinting though, apparently float is enough.

https://stackoverflow.com/questions/50928592/mypy-type-hint-unionfloat-int-is-there-a-number-type/50928627#50928627

@ritchie46 ritchie46 merged commit f304c96 into pola-rs:master Nov 13, 2022
@zundertj
Copy link
Collaborator Author

@thomasaarholt : forgot about that, although I guess it is a trade-off in being a purist (dropping the int annotation), and making Polars users aware what types could be passed in as I expect that, like me, not everyone has it front of mind that float also implies int. That is also visible in the Polars code base: int | float occurs 61 times, float | int occurs 11 times.

@thomasaarholt
Copy link
Contributor

Good point, and agreed :)

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.

pl.col(...).is_between is missing typing for date
3 participants