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

Example of custom macros in get_where_subquery #2418

Merged
merged 5 commits into from
Dec 1, 2022

Conversation

jtcohen6
Copy link
Collaborator

Description & motivation

We get this question a lot:

Folks want to be able to stick custom macros in the where config for tests. While that isn't directly possible today — and that limitation is worth documenting explicitly — there's a halfway-decent workaround that's worth documenting.

@netlify
Copy link

netlify bot commented Nov 18, 2022

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit 0f8d3ef
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/63891d5df8f1230008fd90e4
😎 Deploy Preview https://deploy-preview-2418--docs-getdbt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added content Improvements or additions to content size: small This change will take 1 to 2 days to address labels Nov 18, 2022
Copy link
Contributor

@dbeatty10 dbeatty10 left a comment

Choose a reason for hiding this comment

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

This is... __wild__! Thank you for documenting this possibility!

It's an example of very __lightweight__, roll-your-own string interpolation using __magic__ strings rather than start/end delimiters. Now I'm curious how far an __enterprising__ person could get with defining and parsing their own delimiters!

(Feel free to go on your own Mad Libs® adventure and replace my comments above using the adjectives of your choice.)


Two things to resolve (both of which have inline suggestions):

  1. Choose either "use" or "access" as the MadLibs verb to proceed "custom macros" (but probably not both)
  2. Choose whether or not to namespace the dateadd and current_timestamp macros

website/docs/reference/resource-configs/where.md Outdated Show resolved Hide resolved
website/docs/reference/resource-configs/where.md Outdated Show resolved Hide resolved
website/docs/reference/resource-configs/where.md Outdated Show resolved Hide resolved
mirnawong1 and others added 3 commits November 30, 2022 12:31
Just picked some options so we can get this merged. Nothing stopping us from continuing to make updates if we change our minds.
@dbeatty10 dbeatty10 self-requested a review December 1, 2022 21:41
Copy link
Contributor

@dbeatty10 dbeatty10 left a comment

Choose a reason for hiding this comment

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

Just committed some suggestions from my original review to get this merged.

If it turns out we actually wanted different text, there is nothing stopping us from continuing to make updates.

@dbeatty10 dbeatty10 merged commit bca2272 into current Dec 1, 2022
@dbeatty10 dbeatty10 deleted the jerco/custom-macros-in-where branch December 1, 2022 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content size: small This change will take 1 to 2 days to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants