#16559·dbt-core

Local unit compute returns NULL for supported MON/HH12 TRY_TO_TIMESTAMP format

Author: ujguptaCreated Oct 1, 2026Updated Oct 1, 2026
Labelstriage

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.

sql
SELECT TRY_TO_TIMESTAMP(
  'Jan 10, 2023 09:00 AM', 'MON DD, YYYY HH12:MI AM'
) IS NOT NULL AS parsed

Expected: 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:

sql
SELECT 1 AS id

models/timestamp_parser.sql:

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:

yaml
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.