You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update tests and reindent for native typed cursor results after OID fix
The previous commit makes pgduck_server send real PostgreSQL type OIDs
in its row description instead of InvalidOid. With proper OIDs, psycopg2
correctly parses each column into its native Python type (int, bool,
datetime, Decimal, memoryview) instead of silently coercing everything
to str via TEXTOID fallback.
Tests written against the old buggy behavior compared expected values
to strings. Update the affected assertions to expect native types — or,
where the test compares a cursor result against a CSV-parsed transmit
result, stringify the cursor side via the existing converters.
Also runs pgindent on type_conversion.{c,h} and duckdb.c to fix
whitespace nits introduced by the previous commit.
Notable test changes:
- test_common/helpers/db.py: run_simple_command now expects [(1,)] not
[("1",)]; this single helper was responsible for ~17 failures across
test_pgbench, test_server_protocol_failures, test_psql,
test_cancellations, and test_simple_server.
- test_types.py: fix the long-standing latent interval-arithmetic
mismatch — the existing normalizer assumes a 360-day year, but
psycopg2 converts PG `interval` directly to timedelta using a
365-day year (and PG normalizes "16 mons 15 days" to "1 yr 4 mons 15
days"), so PG cursor results need their own expected list.
- test_identity_partitioned_writes.py / test_date_partitioned_writes.py
/ test_truncate_partitioned_writes.py: lake_table.data_file_partition_values.value
is text, but res[0][0] from pgduck via SELECT DISTINCT col is now
native — branch on col_type and cast appropriately (BOOLEAN partition
values are stored as "t"/"f", BYTEA as "\\x...", others compare via
str()).
Signed-off-by: Marco Slot <marco.slot@snowflake.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments