Skip to content

Verify logicalType for semi-structured columns in datacontract test#1373

Merged
jschoedl merged 13 commits into
mainfrom
fix/snowflake-complex-type-checks
Jul 10, 2026
Merged

Verify logicalType for semi-structured columns in datacontract test#1373
jschoedl merged 13 commits into
mainfrom
fix/snowflake-complex-type-checks

Conversation

@jschoedl

@jschoedl jschoedl commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Makes the datacontract test field_type (logicalType) check work for semi-structured columns:

  • Snowflake OBJECT/ARRAY (and equivalent map/array types on other backends) now pass instead of failing with "column type could not be determined".
  • Dynamically-typed columns (VARIANT/JSON, Databricks Variant) fail with an actionable message directing to physicalType.

Fix lives at the backend-agnostic ibis-dtype layer. Verified live against Snowflake.

🤖 Generated with Claude Code

jschoedl and others added 13 commits July 9, 2026 10:05
Snowflake OBJECT/ARRAY (and equivalent map/array types on other backends)
now pass the field_type check instead of failing with "column type could
not be determined". Dynamically-typed columns (VARIANT/JSON, and Databricks
Variant) fail with an actionable message directing to physicalType.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pe-check failure

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…/ARRAY columns

Reads the nested type tree from SHOW COLUMNS, which ibis collapses to
map<string, json> / array<json>. Contracts declaring nested fields on a
dynamically-typed column now fail instead of silently passing.
…r structs

An ibis struct whose fields are all unrepresentable collapsed to
properties=None, the same value used for an untyped map, so a contract
declaring nested fields on such a column was told its structure could not
be verified. Reserve None for the map and give a struct its field list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The object path was interpolated unquoted, so a case-sensitive table was
never found and a structured OBJECT silently fell back to the collapsed
ibis dtype. Contract-supplied parts also reached raw_sql unescaped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A field whose type carries no ODCS logical type (VARIANT, binary, json)
was dropped from the reconstructed tree, so a present column was reported
as missing. Keep it, marked unverifiable, and name the offending type in
a single failure message shared by the top-level and nested paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nd diagnostics

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The catalog reports a structured OBJECT/ARRAY as its bare token, so a
parameterized physicalType always failed and the fallback that was meant to
consume the recovered tree was never reached. Feed the rendered native type in
as the actual instead. A leaf with no verifiable logical type is now kept too,
so a VARIANT column names itself instead of ibis's json.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jschoedl
jschoedl merged commit 22a3691 into main Jul 10, 2026
15 checks passed
@jschoedl
jschoedl deleted the fix/snowflake-complex-type-checks branch July 10, 2026 15:38
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.

1 participant