question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Defer to prod manifest for partial runs

See original GitHub issue

See also #1612, #1603, and #2465

Describe the feature

In a partial run of dbt (eg. dbt run -m my_model+), all of the parents of my_model and its children must exist for the run to succeed. To this end, we’ve built the @ selector, but another helpful approach would be to defer to relations created by a production run when these parent models are referenced.

When dbt is provided a prod manifest (#2465), it can rewrite references to models based on the information contained in this manifest. Specifically, references to models which are not included in the run (ie. they are not selected, or they are explicitly excluded) should be interpolated as a relation captured in the prod manifest.

This flow will support the following use-cases:

  • Slim CI builds that only run new and changed models (without building their parents)
  • Local development (don’t run large Snowplow models in dev)
  • Orgs with multiple projects where users don’t have permissions to run models in an upstream package

Things to discuss:

  • Is this automatic? Or should models be configured as “deferrable” in some way?
  • If it needs to be enabled explicitly, is this a model config, a run flag, or something else?
  • What happens if a model is not selected and also is not in the prod manifest?
  • Does this have any impact on non-models?
    • Seeds
    • Snapshots
    • Tests
  • How does this impact the generated manifest for the run? Are the “borrowed” prod models included in the generated manifest? Should they render in the auto-generated documentation?

Additional context

Let’s approach this separately from #2465 but keep this context in mind

Who will this benefit?

  • CI
  • Local dev
  • Large, sprawling, microproject architecture deployments

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
beckjakecommented, Jul 29, 2020

I think this is not a “dbt version” situation, but actually a “schema version” situation.

1reaction
jtcohen6commented, Jul 29, 2020

It occurs to me that deferring to artifacts generated by a different dbt version may have surprising effects, in the event that the manifests look quite different. That’s:

  • a caveat to document
  • all the more reason we need to include dbt versions in all generated artifacts, so we can raise a concrete warning
Read more comments on GitHub >

github_iconTop Results From Across the Web

Defer to prod manifest for partial runs · Issue #2527 - GitHub
In a partial run of dbt (eg. dbt run -m my_model+ ), all of the parents of my_model and its children must exist...
Read more >
Defer | dbt Developer Hub
Defer is a powerful feature that makes it possible to run a subset of models or tests in a sandbox environment, without having...
Read more >
Deferred components - Flutter documentation
Step 1: Dependencies and initial project setup · Step 2: Implementing deferred Dart libraries · Step 3: Building the app · Running the...
Read more >
PowerManager - Android Developers
Wake lock level: Ensures that the CPU is running; the screen and keyboard ... but the CPU will be kept on until all...
Read more >
Persistent Service Worker in Chrome Extension - Stack Overflow
Service worker (SW) can't be persistent by definition and the browser must forcibly terminate all of SW connections such as network requests ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found