-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Do not require a profile in "dbt deps" (#2231) #2290
Conversation
…s instead Add tests
- remove import cycle - works even if adapter class has been loaded but adapter object has not been registered
daa2e07
to
f0a4810
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment here, but also a question: how would a user actually trigger the attribute error shown in this diff? In my experiments, I'm unable to actually reach that codepath (even if i reference target.user
in my packages.yml
file)
core/dbt/config/runtime.py
Outdated
@@ -171,3 +173,172 @@ def get_metadata(self) -> ManifestMetadata: | |||
project_id=self.hashed_name(), | |||
adapter_type=self.credentials.type | |||
) | |||
|
|||
|
|||
class PoisonedCredentials(Credentials): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we s/Poisoned/Unset
here? I'm also open to:
- InvalidConfig
- NotPresentConfig
- MissingConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I don't care at all what we call it
I don't think a user could. I think a code change inside dbt could inadvertently do so, and I'm interested in that not happening silently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - LGTM when the tests are passing
resolves #2231
Description
In "dbt deps", if a profile cannot be found/loaded, use invalid values instead. The generated rendering context for projects in this case will still contain
target
, but it will be empty.This works by overriding all the profile-ish elements of
RuntimeConfig
if a real profile can't be found. If a real profile is found,deps
will use a fullRuntimeConfig
like previously.Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.