Skip to content

Fix case mismatch in dbt-date round_timestamp test fixture#253

Merged
sdebruyn merged 1 commit into
mainfrom
fix/dbt-date-round-timestamp-case-mismatch
May 17, 2026
Merged

Fix case mismatch in dbt-date round_timestamp test fixture#253
sdebruyn merged 1 commit into
mainfrom
fix/dbt-date-round-timestamp-case-mismatch

Conversation

@sdebruyn
Copy link
Copy Markdown
Owner

Summary

  • Fixes the expression_is_true_test_dates_rounded_timestamp_dbt_date_round_timestamp_time_stamp_ test failure (2 rows not matching) in the DW integration tests for the dbt-date package.
  • The get_test_dates() override used a Jinja replace filter matching DATETIME2(6) (uppercase), but fabric__type_timestamp() resolves to datetime2(6) (lowercase via the Jinja macro in dbt_expectations/utils/datatypes.sql). The replacement never fired, so the expected rounded_timestamp column stayed at '2021-06-07' while round_timestamp() correctly computed '2021-06-08'.
  • The UTC variant passed because rounded_timestamp_utc already had the correct expected value ('2021-06-08') from the upstream fixture.

Test plan

  • Run /test-dw TestDbtDate to confirm the round_timestamp assertion passes

🤖 Generated with Claude Code

The get_test_dates() override used a string replacement that looked for
'DATETIME2(6)' (uppercase), but fabric__type_timestamp() returns
'datetime2(6)' (lowercase via the Jinja macro override). The replacement
never matched, leaving rounded_timestamp as '2021-06-07' while
round_timestamp() computed '2021-06-08', causing 2 rows to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 17, 2026 16:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a dbt-date integration test fixture override so the expected rounded_timestamp value is correctly patched for Fabric’s lowercase datetime2(6) rendering.

Changes:

  • Updates the Jinja replace filter to match datetime2(6) casing.
  • Keeps the override focused on the known UTC round_timestamp expectation mismatch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sdebruyn
Copy link
Copy Markdown
Owner Author

/test-dw -k TestDbtDate

@github-actions
Copy link
Copy Markdown

DW integration tests failed

Filter: k TestDbtDate
Run: https://github.com/sdebruyn/dbt-fabric/actions/runs/25996253088

@sdebruyn
Copy link
Copy Markdown
Owner Author

/test-dw TestDbtDate

@github-actions
Copy link
Copy Markdown

DW integration tests passed

Filter: TestDbtDate
Run: https://github.com/sdebruyn/dbt-fabric/actions/runs/25996270418

@sdebruyn sdebruyn merged commit a32ce3e into main May 17, 2026
8 checks passed
@sdebruyn sdebruyn deleted the fix/dbt-date-round-timestamp-case-mismatch branch May 17, 2026 16:25
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.

2 participants