Bird
0
0

Which of the following is the correct syntax to pin a dbt package version to exactly 1.0.0 in packages.yml?

easy📝 Syntax Q12 of 15
dbt - Packages and Reusability
Which of the following is the correct syntax to pin a dbt package version to exactly 1.0.0 in packages.yml?
A- package: dbt-labs/dbt_utils version: ">=1.0.0,<2.0.0"
B- package: dbt-labs/dbt_utils version: "1.0.0"
C- package: dbt-labs/dbt_utils version: "=1.0.0"
D- package: dbt-labs/dbt_utils version: "~>1.0.0"
Step-by-Step Solution
Solution:
  1. Step 1: Review version pinning syntax in packages.yml

    To pin exactly one version, use the version string with the exact version number in quotes, like "1.0.0".
  2. Step 2: Analyze options

    - package: dbt-labs/dbt_utils version: ">=1.0.0,<2.0.0" uses a range, not exact pinning. - package: dbt-labs/dbt_utils version: "=1.0.0" uses an invalid syntax with '='. - package: dbt-labs/dbt_utils version: "~>1.0.0" uses a pessimistic operator (~>), which allows patch updates.
  3. Final Answer:

    - package: dbt-labs/dbt_utils version: "1.0.0" -> Option B
  4. Quick Check:

    Exact version pin = "1.0.0" [OK]
Quick Trick: Exact pin uses just the version string in quotes [OK]
Common Mistakes:
MISTAKES
  • Using '=' before version number incorrectly
  • Confusing range syntax with exact pin
  • Using pessimistic operator when exact pin needed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes