-
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
✨ restructure deps command with package-lock.yml #6735
Changes from all commits
5261bfe
5507a0e
f0cf216
8ae24e4
94d208f
948d400
93f72f4
a3df280
0e01c2e
9995193
e182821
5615910
5eb279f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: add log file of installed packages via dbt deps | ||
time: 2023-01-25T16:59:33.786304-05:00 | ||
custom: | ||
Author: jusbaldw | ||
Issue: "6643" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,13 +94,14 @@ def _load_yaml(path): | |
return load_yaml_text(contents) | ||
|
||
|
||
def package_data_from_root(project_root): | ||
package_filepath = resolve_path_from_base("packages.yml", project_root) | ||
def package_data_from_root(project_root, package_file_name="packages.yml"): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the update and how this is being used it seems like just more of a function to load a yaml file vs anything related to package data. Maybe consider not have the default value for |
||
package_filepath = resolve_path_from_base(package_file_name, project_root) | ||
|
||
if path_exists(package_filepath): | ||
packages_dict = _load_yaml(package_filepath) | ||
else: | ||
packages_dict = None | ||
|
||
return packages_dict | ||
|
||
|
||
|
@@ -502,6 +503,7 @@ def from_project_root( | |
project_root = os.path.normpath(project_root) | ||
project_dict = load_raw_project(project_root) | ||
config_version = project_dict.get("config-version", 1) | ||
|
||
if config_version != 2: | ||
raise DbtProjectError( | ||
f"Invalid config version: {config_version}, expected 2", | ||
|
@@ -510,6 +512,7 @@ def from_project_root( | |
|
||
packages_dict = package_data_from_root(project_root) | ||
selectors_dict = selector_data_from_root(project_root) | ||
|
||
return cls.from_dicts( | ||
project_root=project_root, | ||
project_dict=project_dict, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
I figured out why
invoke_without_command=True
doesn't work for this case. Everything in click works, but in Flags we did some not ideal lookup here that made the assumption that a function name should always match the last part of input command. I will create a follow up ticket for that but you will find that if you change function namedeps_install
anddeps_lock
below to justinstall
andlock
, you should be able to run without any issue. One thing that I didn't check is whether the params at group level is correctly represented in Flags.