Skip to content

fix: Allow float('nan') as value in join for duckdb - #3555

Merged
FBruzzesi merged 3 commits into
mainfrom
fix/issue-3554
May 4, 2026
Merged

FBruzzesi merged 3 commits into
mainfrom
fix/issue-3554

Conversation

@FBruzzesi

Copy link
Copy Markdown
Member

Description

It does not fully solve the issue but:

  • Solves it for duckdb
  • Explicitly xfail for pandas-like + dask case

What type of PR is this? (check all applicable)

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

@FBruzzesi FBruzzesi added fix PR that fixes a bug. Release notes: 🐞 Bug fixes duckdb duckdb backend labels Apr 18, 2026
FBruzzesi added a commit that referenced this pull request Apr 18, 2026

@MarcoGorelli MarcoGorelli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks @FBruzzesi ! looks good on green

love the attention to detail here

Comment on lines +310 to +313
# Use `==` to preserve the polars semantic of `null != null` in joins,
# and additionally match `NaN = NaN` since `==` in DuckDB treats `NaN`
# like SQL `NULL` (see https://github.com/narwhals-dev/narwhals/issues/3554).
# `isnan` is safe to apply as it returns `false` for non-float columns.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

love this comment

@FBruzzesi
FBruzzesi merged commit 0d7f352 into main May 4, 2026
35 of 36 checks passed
@FBruzzesi
FBruzzesi deleted the fix/issue-3554 branch May 4, 2026 10:19
@jiemakel

Copy link
Copy Markdown

This change may have broken duckdb joins for non-numeric columns. At least I'm getting:

BinderException: Binder Error: No function matches the given name and argument types 'isnan(VARCHAR)'. You might need to add explicit type casts.
	Candidate functions:
	isnan(FLOAT) -> BOOLEAN
	isnan(DOUBLE) -> BOOLEAN

bubbling up from duckdb (1.5.2) now when trying to join two duckdb LazyFrames using a string column.

@FBruzzesi

FBruzzesi commented May 16, 2026 •

Copy link
Copy Markdown
Member Author

Hey @jiemakel - thanks for reporting! I will address this today.

@MarcoGorelli I would consider yanking 2.21.0 due to this regression and releasing a patched/minor version

@MarcoGorelli

Copy link
Copy Markdown
Member

thanks for the report!

i'll make a quick patch release, not sure this is critical enough to warrant yanking 2.21

MarcoGorelli added a commit to MarcoGorelli/narwhals that referenced this pull request May 16, 2026
MarcoGorelli added a commit to MarcoGorelli/narwhals that referenced this pull request May 16, 2026
MarcoGorelli added a commit that referenced this pull request May 16, 2026
@FBruzzesi

Copy link
Copy Markdown
Member Author

I think it might be worth yanking for a regression such as this one. On the cons, between this PR and the patch, we shipped the one to drop support for python 3.9

@MarcoGorelli

Copy link
Copy Markdown
Member

i'd suggest only yanking releases for security issues, or for "silent but deadly" bugs, here it gives a loud exception

dangotbanned added a commit that referenced this pull request May 19, 2026
commit 9d015e2031acd5e10404da72a7d698c632446c49
Author: Marco Edward Gorelli <[email protected]>
Date:   Sat May 16 09:51:39 2026 +0100

    release: Bump version to 2.21.2 (#3630)

commit 8674e44f657110b45aedffb8c1343d5b0505bb01
Author: Marco Edward Gorelli <[email protected]>
Date:   Sat May 16 09:37:56 2026 +0100

    release: Bump version to 2.21.1 (#3628)

commit 739dc579adfd38a75764d6d2c09ed42b0f2e887a
Author: Marco Edward Gorelli <[email protected]>
Date:   Sat May 16 09:35:33 2026 +0100

    ci: remove `downstream_tests_slow` (#3629)

commit 1f36279bb07203628ddd18a691cf98d4c78780d3
Author: Marco Edward Gorelli <[email protected]>
Date:   Sat May 16 09:17:10 2026 +0100

    Revert "fix: Allow `float('nan')` as value in join for duckdb (#3555)" (#3627)

    This reverts commit 0d7f352.

commit 1e50d020e3ca5e5c5dfe3486e53190e87c60b66c
Author: Pedro <[email protected]>
Date:   Fri May 15 13:05:01 2026 +0200

    [Enh]: Add the negation unary operator for expressions and series (#3625)

    negation unary operator for expressions and series

commit 37ea7953f6b455736bf6ae353ca257f468b3b083
Author: Francesco Bruzzesi <[email protected]>
Date:   Wed May 13 10:38:42 2026 +0200

    ci: Unpin "temporary" CI pins (#3618)

    * ci: Unpin 'temporary' CI pins

    * rollback formulaic and pointblank

commit 4ff3a1f545924e5e38e76c4d8a71de2010a2f4d6
Author: Francesco Bruzzesi <[email protected]>
Date:   Tue May 12 19:11:11 2026 +0200

    chore: Prepare for future pandas inplace deprecation (#3616)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duckdb duckdb backend fix PR that fixes a bug. Release notes: 🐞 Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants