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

Added isnone() function #801

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Added isnone() function #801

wants to merge 18 commits into from

Conversation

ilongin
Copy link
Contributor

@ilongin ilongin commented Jan 7, 2025

isnone(...) function returns True if column or literal value is None / NULL, otherwise False

Note that this doesn't currently work for Clickhouse where we don't have nullable columns. We should decide if we want to introduce nullable columns and if yes, this will work there as well.

UPDATE:
In addition, this PR extends case() function and related codebase to accept nested functions in:

  1. Case condition - value (both places)
  2. Case else_ value

This will allow usage of functions inside other functions that are based on case like ifelse or isnone as well. We also will have ability to do nested cases etc.

@ilongin ilongin linked an issue Jan 7, 2025 that may be closed by this pull request
@ilongin ilongin marked this pull request as draft January 7, 2025 14:31
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.44%. Comparing base (1962a64) to head (33faee1).

Files with missing lines Patch % Lines
src/datachain/func/func.py 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #801   +/-   ##
=======================================
  Coverage   87.44%   87.44%           
=======================================
  Files         128      128           
  Lines       11368    11384   +16     
  Branches     1545     1549    +4     
=======================================
+ Hits         9941     9955   +14     
- Misses       1038     1039    +1     
- Partials      389      390    +1     
Flag Coverage Δ
datachain 87.39% <93.54%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link

cloudflare-workers-and-pages bot commented Jan 9, 2025

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 33faee1
Status: ✅  Deploy successful!
Preview URL: https://0239235d.datachain-documentation.pages.dev
Branch Preview URL: https://ilongin-800-isnone-function.datachain-documentation.pages.dev

View logs

@ilongin ilongin marked this pull request as ready for review January 10, 2025 11:15
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.

Add isnone() function
2 participants