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

Add information about defer & compile #5162

Closed
wants to merge 7 commits into from

Conversation

siljamardla
Copy link
Contributor

@siljamardla siljamardla commented Mar 26, 2024

What are you changing in this pull request and why?

Adding information about how defer and compile work together.
Stumbled upon this functionality and decided to document it for the benefit of others.

Stumbled upon this functionality and decide to document it for the benefit of others.
@siljamardla siljamardla requested a review from a team as a code owner March 26, 2024 07:06
Copy link

welcome bot commented Mar 26, 2024

Hello!👋 Thanks for contributing to the dbt product documentation and opening this pull request! ✨
We use Markdown and some HTML to write the dbt product documentation. When writing content, you can use our style guide and content types to understand our writing standards and how we organize information in the dbt product docs.
We'll review your contribution and respond as soon as we can. 😄

Copy link

vercel bot commented Mar 26, 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 9, 2024 2:58pm

@runleonarun runleonarun added the new contributor Label for first-time contributors label Mar 26, 2024
@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 Mar 26, 2024
@mirnawong1
Copy link
Contributor

hey @siljamardla , thanks for opening this up! i'm going to work with the team internally with this and will revert back with more info! really appreciate your contributions ✨ !

@mirnawong1
Copy link
Contributor

hey @siljamardla , can you provide more insight on your proposed changes? Wondering if you're experiencing this scenario where you have dev artifacts that dbt is favoring?

@siljamardla
Copy link
Contributor Author

hey @siljamardla , can you provide more insight on your proposed changes? Wondering if you're experiencing this scenario where you have dev artifacts that dbt is favoring?

Will have to test again to be sure. But if you have tested and you're sure that defer also works with full compile, feel free to modify my PR. The main point is to make it known that defer also works with compile.

@siljamardla
Copy link
Contributor Author

siljamardla commented Apr 1, 2024

Hey @mirnawong1
Tested again.

  • I dropped my dev schema
  • I ran dbt compile --defer --state target/live (this is where I store the latest live manifest)
  • Checked the compiled output. All the refs use my personal schema name.
  • I recreated my dev schema. I checked that there are no tables in it.
  • I ran dbt compile --defer --state target/live again
  • Checked the compiled output, again all the refs use my personal schema name.
  • I ran dbt compile --defer --state target/live --select my_model_name > target/tmp_my_model_name.sql
  • Checked the output, in this one all the refs have been compiled to use the live schema names
  • Just in case, I deleted my target folder and went through the same routine again, still the same outcome

Thus, I stand by the claim that defer does not work on dbt compile, but it does work when you compile something specific.

@siljamardla
Copy link
Contributor Author

@mirnawong1, even if you plan to investigate and/or fix anything, I think it's valuable information that should be added to the docs meanwhile.

@mirnawong1
Copy link
Contributor

Thanks so much @siljamardla ! Will take a look at this tomorrow and also would like to cc @dave-connors-3 as well!

@mirnawong1 mirnawong1 self-assigned this Apr 5, 2024
@dave-connors-3
Copy link
Contributor

dave-connors-3 commented Apr 9, 2024

@mirnawong1 @siljamardla hello there! i definitely believe this to be unintended behavior, and should go through core support, and not land in the docs site until we get a bit more clarity into what's going on!

@siljamardla, would you be willing to open up an issue on dbt-core, and document the steps you showed above? If i end up mistaken (which happens a whole lot!) we can come back here and update the docs accordingly

@mirnawong1
Copy link
Contributor

hey @siljamardla , thank for your patience here! I've had a chat with @dave-connors-3 and this sounds like unintended behavior and possibly a bug. could you please open a core issue for the team to look at?

appreciate your insight and looking forward to your future docs contributions ✨! thank you as well @dave-connors-3 !

@mirnawong1
Copy link
Contributor

i'll close this pr out and happy to reopen at a later point. thanks again!

@siljamardla
Copy link
Contributor Author

As suggested, I've created an issue:
dbt-labs/dbt-core#9991

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 new contributor Label for first-time contributors 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.

4 participants