Skip to content

fix: keep duplicate rows in vertical concat; Decimal/Binary dtypes, unique without order_by, column-name errors, sum_horizontal of nulls, tuple literals - #150

Merged
jonasdedden merged 3 commits into
narwhals-dev:mainfrom
jonasdedden:fix/concat-dtypes-unique-errors
Nov 15, 2026
Merged

jonasdedden merged 3 commits into
narwhals-dev:mainfrom
jonasdedden:fix/concat-dtypes-unique-errors

Conversation

@jonasdedden

@jonasdedden jonasdedden commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

A batch of small fixes, mostly to frame-level behaviour.

  • concat(how="vertical") dropped duplicate rows. Daft's DataFrame.union is a set union, so stacking frames with equal rows silently lost data. It now uses concat. In the test suite this only showed up as a row-order mismatch in test_concat_vertical.
  • Decimal and Binary dtypes were read back as Unknown: only decimal128(1, 1) was mapped. Decimals now keep their precision and scale.
  • unique(keep="any") without order_by failed, because row_number needs an ordered window. It now uses DataFrame.distinct(*subset). Missing subset columns are checked up front, as in DuckDB.
  • Column-name errors: missing columns now raise ColumnNotFoundError.from_missing_and_available_column_names, with the name parsed from Daft's Column col(x) not found. Duplicate output names in select/rename raise DuplicateError up front. Daft accepts them, and they used to fail only at collect time inside pyarrow.
  • sum_horizontal returned null when every input was null; Polars returns 0. The fallback zero is UInt8, so the sum keeps its dtype (e.g. Float32).
  • lit of a tuple became a struct in Daft and is now a list, as in Polars.
  • Minimum Daft version raised from 0.5.18 to 0.7.15. Running run_tests.py against older Daft releases showed the old floor was stale:

Rebased onto current main. 24 more cases pass, there are no new failures, and 14 names are dropped from run_tests.py.

Note

I used Claude (Opus 5.5) to help with these changes and this description.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bae6fbe6-3996-4f7d-9fd9-5f0d9a5c4d38
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jonasdedden
jonasdedden force-pushed the fix/concat-dtypes-unique-errors branch from da64a86 to b98a242 Compare November 15, 2026 14:14
…s, unique without order_by, column-name errors, sum_horizontal of nulls, tuple literals
The previous floor (0.5.18) was stale: main already needs 0.7.13 (median,
percentile, concat_ws, struct literals) and the windowed first/last and
join_asof(strategy='nearest') in narwhals-dev#149 need 0.7.15.
@jonasdedden
jonasdedden force-pushed the fix/concat-dtypes-unique-errors branch from b98a242 to 70a8d24 Compare November 15, 2026 14:29
@jonasdedden
jonasdedden merged commit 1edff6f into narwhals-dev:main Nov 15, 2026
4 checks passed
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.

2 participants