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 run_query.md #5199

Closed
wants to merge 3 commits into from
Closed

Update run_query.md #5199

wants to merge 3 commits into from

Conversation

ialdg
Copy link
Contributor

@ialdg ialdg commented Apr 1, 2024

Hi.
This modification proposal is intended to make the code more elegant and less demanding on the warehouse. Regards.
IL.

What are you changing in this pull request and why?

Checklist

Adding or removing pages (delete if not applicable):

  • Add/remove page in website/sidebars.js
  • Provide a unique filename for new pages
  • Add an entry for deleted pages in website/vercel.json
  • Run link testing locally with npm run build to update the links that point to deleted pages

Hi.
This modification proposal is intended to make the code more elegant and less demanding on the warehouse.
Regards.
IL.
@ialdg ialdg requested a review from a team as a code owner April 1, 2024 06:24
Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2024 11:25am

@github-actions github-actions bot added content Improvements or additions to content size: x-small This change will take under 3 hours to fix. labels Apr 1, 2024
@mirnawong1 mirnawong1 self-assigned this Apr 5, 2024
@mirnawong1
Copy link
Contributor

hey @ialdg , great contribution and suggestion! I've collaborated with my teammate @dbeatty10 and it looks like the run_query logic will only run when execute is true regardless if it is guarded with if execute or not. the query will NOT run twice when execute == False and again when execute == True

this is because the run_query is just a user-friendly interface that uses the statement macro. the macro already contains its own [if execute](https://github.com/dbt-labs/dbt-adapters/blob/7392debf7ff1aa5d58c0fe26eb76ac8ade4fe15b/dbt/include/global_project/macros/etc/statement.sql#L5) logic.

based on this, I'm happy to close this pr out since the run_query logic will only run when execute is true. happy to reopen if you have add'l thoughts, and thank you again for contribution ✨

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: x-small This change will take under 3 hours to fix.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants