Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to pin the package version to 1.4.0 in the packages.yml file.
dbt
packages:
- package: dbt-labs/dbt_utils
version: [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using "latest" instead of a fixed version.
Omitting quotes around the version number.
✗ Incorrect
Pinning the version to "1.4.0" ensures the package uses that exact version.
2fill in blank
mediumComplete the command to update dbt packages after changing the version pin.
dbt
dbt [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'dbt run' which runs models but does not update packages.
Using 'dbt test' which runs tests but does not update packages.
✗ Incorrect
The 'dbt deps' command installs or updates packages based on the version pin.
3fill in blank
hardFix the error in the dbt_project.yml to pin the dbt version correctly.
dbt
name: my_project
dbt_version: [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the version number causing YAML parsing errors.
Adding 'version:' again inside the value.
✗ Incorrect
The dbt_version value must be a string with quotes in YAML, so use "1.4.0".
4fill in blank
hardFill both blanks to create a command that updates dbt and then runs models.
dbt
dbt [1] && dbt [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Running models before updating packages.
Using 'test' instead of 'run' to execute models.
✗ Incorrect
First update packages with 'deps', then run models with 'run'.
5fill in blank
hardFill all three blanks to create a dictionary comprehension that filters packages by version.
dbt
filtered_packages = {pkg: ver for pkg, ver in packages.items() if ver [1] [2] and pkg != [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<=' instead of '>=' for filtering newer versions.
Not quoting string values causing syntax errors.
✗ Incorrect
Filter packages with version >= "1.4.0" and exclude 'deprecated_package'.