Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for current_timestamp #5935

Merged
merged 2 commits into from
Sep 26, 2022
Merged

Tests for current_timestamp #5935

merged 2 commits into from
Sep 26, 2022

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Sep 26, 2022

resolves #5933

Description

For {{ dbt.current_timestamp() }}, verify two things we want to test for this macro across adapters:

  1. Does it return a value "close enough" to the Python current time in UTC?
  2. Does the semantic semantic Python data type (timezone-naive vs. timezone-aware) of the result match our expectations?

Some of all of the logic can also be re-used for other macros that return timestamps (like current_timestamp_in_utc), convert_timezone, etc.

Checklist

@dbeatty10 dbeatty10 added the Skip Changelog Skips GHA to check for changelog file label Sep 26, 2022
@cla-bot cla-bot bot added the cla:yes label Sep 26, 2022
Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

LGTM

@dbeatty10 dbeatty10 marked this pull request as ready for review September 26, 2022 18:22
@dbeatty10 dbeatty10 requested a review from a team as a code owner September 26, 2022 18:22
@dbeatty10 dbeatty10 merged commit c202e00 into main Sep 26, 2022
@dbeatty10 dbeatty10 deleted the dbeatty/test-current-timestamp branch September 26, 2022 18:31
@dbeatty10 dbeatty10 mentioned this pull request May 22, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1240] [Feature] Tests for current_timestamp
2 participants