Bird
0
0

This automation script for dbt fails to run properly. What is the error?

medium📝 Debug Q14 of 15
dbt - Production Deployment
This automation script for dbt fails to run properly. What is the error?
import os
os.system('dbt run --models my_model')
print('Run complete')
AThe script lacks error handling for dbt failures
Bdbt command syntax is incorrect
CMissing import for subprocess module
Dos.system does not run shell commands
Step-by-Step Solution
Solution:
  1. Step 1: Analyze os.system usage

    os.system runs shell commands but does not capture success or failure status easily.
  2. Step 2: Identify missing error handling

    The script prints 'Run complete' regardless of whether dbt run succeeded or failed, which is unsafe for production.
  3. Final Answer:

    The script lacks error handling for dbt failures -> Option A
  4. Quick Check:

    Missing error checks cause silent failures [OK]
Quick Trick: Check if script handles errors after commands [OK]
Common Mistakes:
MISTAKES
  • Assuming os.system always succeeds
  • Confusing missing imports with unrelated errors
  • Thinking dbt syntax is wrong here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes