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
When I define model like following, and execute dbt run command, command will succeed if metadata field is really of type STRUCT, but underlying keys in the struct and their corresponding data types won't be checked.
select
id,
CAST(metadata AS STRUCT<property_3 STRING>as metadata
from {{ source('source', 'source_table') }}
I've noticed this when I tried testing and changing my data_type from STRUCT to MAP. In that case dbt run command retuned this error:
definition_type and contract_type are not taking into account values inside complex/nested structures.
Steps To Reproduce
Using model configuration and similar SQL command (that contains STRUCT field) from above, execute dbt run command. Command will succeed no matter what underlying struct configuration is setup in data_type field (works with setting just STRUCT<>).
Expected behavior
I would expect for dbt to fail if contract is enforced, and complex data types like ARRAY, MAP and STRUCT are not fully described, or even better under contract configuration to have check_complex_types boolean field which can decide whether to check nested structures or not.
System information
The output of dbt --version:
dbt Cloud CLI - 0.38.15
dbt-databricks: 1.8.7
The operating system you're using:
macOS 15.1.1
The output of python --version:
Python 3.11.9
The text was updated successfully, but these errors were encountered:
Describe the bug
When I define model like following, and execute
dbt run
command, command will succeed ifmetadata
field is really of typeSTRUCT
, but underlying keys in the struct and their corresponding data types won't be checked.SQL model:
I've noticed this when I tried testing and changing my
data_type
from STRUCT to MAP. In that case dbt run command retuned this error:definition_type
andcontract_type
are not taking into account values inside complex/nested structures.Steps To Reproduce
Using model configuration and similar SQL command (that contains
STRUCT
field) from above, executedbt run
command. Command will succeed no matter what underlying struct configuration is setup indata_type
field (works with setting justSTRUCT<>
).Expected behavior
I would expect for dbt to fail if
contract
is enforced, and complex data types likeARRAY
,MAP
andSTRUCT
are not fully described, or even better undercontract
configuration to havecheck_complex_types
boolean field which can decide whether to check nested structures or not.System information
The output of
dbt --version
:The operating system you're using:
macOS 15.1.1
The output of
python --version
:Python 3.11.9
The text was updated successfully, but these errors were encountered: