Local unit compute returns NULL for supported MON/HH12 TRY_TO_TIMESTAMP format
Behavior
With dbt 2.0.6 experimental local unit compute on the Snowflake adapter, TRY_TO_TIMESTAMP returns NULL for a supported format that parses successfully on Snowflake. A boolean assertion exposes the issue without depending on timestamp rendering.
SELECT TRY_TO_TIMESTAMP(
'Jan 10, 2023 09:00 AM', 'MON DD, YYYY HH12:MI AM'
) IS NOT NULL AS parsedExpected: true. Core 1.11.15 / Snowflake adapter 1.11.5 executing the expression on Snowflake returns true. dbt 2.0.6 local unit compute returns false.
Minimal unit project
Enable DBT_ENGINE_EXPERIMENTAL_LOCAL_UNIT_TESTS=true and set project unit_tests +compute: local for the project's package. Use an existing Snowflake dev profile; there are no real data inputs or relation builds.
models/one.sql:
SELECT 1 AS idmodels/timestamp_parser.sql:
SELECT TRY_TO_TIMESTAMP(
'Jan 10, 2023 09:00 AM', 'MON DD, YYYY HH12:MI AM'
) IS NOT NULL AS parsed
FROM {{ ref('one') }}models/tests.yml:
unit_tests:
- name: supported_format_parses
model: timestamp_parser
given:
- input: ref('one')
format: sql
rows: 'SELECT CAST(1 AS number(38, 0)) AS id'
expect:
rows:
- {parsed: true}Run dbt test --select supported_format_parses. The local comparison reports true -> false. All values are synthetic. This blocks validating parse-success fallback logic locally; the expectation has not been changed to accept NULL.
Source: dbt-labs/dbt-core