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

Merged
merged 20 commits into from
Jan 20, 2025
Merged

Added isnone() function #801

merged 20 commits into from
Jan 20, 2025

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.42%. Comparing base (d648134) to head (e433f48).
Report is 1 commits behind head on main.

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.45%   87.42%   -0.03%     
==========================================
  Files         128      128              
  Lines       11408    11424      +16     
  Branches     1553     1557       +4     
==========================================
+ Hits         9977     9988      +11     
- Misses       1041     1044       +3     
- Partials      390      392       +2     
Flag Coverage Δ
datachain 87.36% <93.54%> (-0.03%) ⬇️

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: e433f48
Status: ✅  Deploy successful!
Preview URL: https://c97d121b.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
@ilongin ilongin merged commit 7cfee4b into main Jan 20, 2025
38 checks passed
@ilongin ilongin deleted the ilongin/800-isnone-function branch January 20, 2025 13:22
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