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

chore(test): consolidate ifelse() and case() tests #9560

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

NickCrews
Copy link
Contributor

Prepping for #9096

  • moves several .ifelse() and .substitute() tests from ibis/backens/test/test_generic.py into a new test_conditionals.py
  • moves some .case() tests from the pandas and dask backends into there, so the other backends are now tested as well, and removed duplication.
  • adds a test case that ibis.literal(5).nullif(5).case().when(None, "oops").else_("expected") results in "expected". Not saying this is actually the best behavior,
    but it is currently what we claim to be expected. Perhaps we want to revisit.

Prepping for ibis-project#9096

- moves several .ifelse() and .substitute() tests from ibis/backens/test/test_generic.py into a new test_conditionals.py
- moves some .case() tests from the pandas and dask backends into there, so the other backends are now tested as well, and removed duplication.
- adds a test case that `ibis.literal(5).nullif(5).case().when(None, "oops").else_("expected")` results in "expected". Not saying this is actually the best behavior,
but it is currently what we claim to be expected. Perhaps we want to revisit.
Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

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

LGTM!

@cpcloud cpcloud added this to the 9.2 milestone Jul 15, 2024
@cpcloud cpcloud added the tests Issues or PRs related to tests label Jul 15, 2024
@cpcloud
Copy link
Member

cpcloud commented Jul 15, 2024

None being treated as False is consistent with how NULLs behave in other expressions where this comes up like joins.

@cpcloud cpcloud merged commit 9b797f6 into ibis-project:main Jul 15, 2024
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants