Bird
0
0

Which of the following is required to call a macro from another dbt project?

easy📝 Conceptual Q2 of 15
dbt - Jinja in dbt
Which of the following is required to call a macro from another dbt project?
AThe macro must be defined in the current project's macros folder
BBoth projects must use the same database schema
CThe macro must be converted to a model first
DThe other project must be listed as a dependency in packages.yml
Step-by-Step Solution
Solution:
  1. Step 1: Check dependency setup

    To use macros from another project, that project must be added as a dependency in the packages.yml file.
  2. Step 2: Understand macro location

    Macros in the other project become accessible only if the dependency is declared; same schema or converting macros to models is not required.
  3. Final Answer:

    The other project must be listed as a dependency in packages.yml -> Option D
  4. Quick Check:

    Cross-project macro call requires dependency declaration [OK]
Quick Trick: Declare dependencies in packages.yml to share macros [OK]
Common Mistakes:
MISTAKES
  • Assuming same schema is needed
  • Thinking macros must be models
  • Expecting macros to be local only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes