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

Update data_freshness_assertions.js #7

Merged
merged 1 commit into from
May 22, 2024
Merged

Conversation

alexvys
Copy link
Contributor

@alexvys alexvys commented May 16, 2024

This resolves the error of when you are trying to use HOURS instead of just using days/weeks/months/etc.

This resolves the error of when you are trying to use HOURS instead of just using days/weeks/months/etc.
@alexvys alexvys requested a review from hrialan as a code owner May 16, 2024 09:29
@alexvys
Copy link
Contributor Author

alexvys commented May 16, 2024

Hi @hrialan

I've checked it in my environment and this resolved the issue of using 'hour' and other timestamp fields in the freshness checks. Without this implementation any assertion for a timestamp field (like checks for the freshness of <4h would result in an error like this "Query error: DATE_DIFF does not support the HOUR date part when the argument is DATE type at [18:25]".

Please approve the pull request :)

@alexvys
Copy link
Contributor Author

alexvys commented May 22, 2024

Hey @hrialan :)
Could you please approve this tiny pull request? This would help me a lot! Thank you!

praying_cat

@hrialan
Copy link
Collaborator

hrialan commented May 22, 2024

@alexvys it seems not to work, I will revert changes

Capture d’écran 2024-05-22 à 11 38 40

@alexvys
Copy link
Contributor Author

alexvys commented May 22, 2024

Hmm... That's weird... maybe because the timezone was added in between the versions that I was using

Screenshot 2024-05-22 at 12 09 11

Here is what worked for me.

@alexvys
Copy link
Contributor Author

alexvys commented May 22, 2024

Maybe this is the solution then:

TIMESTAMP_DIFF(CURRENT_TIMESTAMP("${timeZone}"), MAX(${dateColumn}), ${timeUnit}) AS delay

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.

None yet

2 participants