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

Cross-database date macro #191

Merged
merged 3 commits into from
May 1, 2024
Merged

Cross-database date macro #191

merged 3 commits into from
May 1, 2024

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented May 1, 2024

resolves #192

Problem

To support a built-in metricflow_time_spine in dbt-labs/dbt-core#8825, we want to create a date macro that converts (year, month, day) arguments into a SQL DATE type.

Solution

Add a new cross-database macro named date() that takes three integer parameters (year, month, day) and renders SQL that will create an associated scalar date value in the target data platform.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development, and it appears to resolve the stated issue
  • This PR includes tests
  • This PR has already received feedback and approval from Product or DX

@cla-bot cla-bot bot added the cla:yes label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-3208] [Feature] Cross-database date macro
2 participants