Skip to content

[codex] fix temporal values from from_list#54

Merged
cigrainger merged 1 commit into
mainfrom
codex/fix-temporal-list-values
May 2, 2026
Merged

[codex] fix temporal values from from_list#54
cigrainger merged 1 commit into
mainfrom
codex/fix-temporal-list-values

Conversation

@cigrainger
Copy link
Copy Markdown
Contributor

Summary

  • Encode Elixir Date, Time, NaiveDateTime, and DateTime structs as typed DuckDB literals in the small-list from_list/1 SQL path.
  • Add a regression test covering temporal values in small lists.

Root Cause

Small list sources are represented as inline SELECT ... UNION ALL ... SQL, but Dux.QueryBuilder.encode_value/1 only handled nil, numbers, booleans, and strings. Temporal structs therefore raised a FunctionClauseError before DuckDB could evaluate the query. Large lists already used ADBC ingestion and did not hit this encoder.

Validation

  • mix test test/dux/verb_test.exs
  • Manual reproduction with Dux.peek/1 on the example from the issue

Fixes #51

@cigrainger cigrainger marked this pull request as ready for review May 2, 2026 23:04
@cigrainger cigrainger merged commit 84885cb into main May 2, 2026
5 checks passed
@cigrainger cigrainger deleted the codex/fix-temporal-list-values branch May 2, 2026 23:07
@srowley
Copy link
Copy Markdown
Contributor

srowley commented May 3, 2026

Thanks! I am starting to get a little more familiar with the library and noticed that pin interpolation doesn't support temporal values. I wrote a fix and a test for that. The test passes after the fix and my uses for that functionality now work, but I can't run the entire test suite without getting a bunch of out-of-memory errors.

If you'd like me to submit a pull request with that I'm happy to; I just can't guarantee it didn't break something else.

Edit - I figured out how to run tests; pull request forthcoming. Also a separate PR for consideration that fixed the tests for me.

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.

Error raised computing data with dates

2 participants