0
0
dbtdata~10 mins

Loading CSV seeds in dbt - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the path of the CSV seed file in the dbt project configuration.

dbt
seeds:
  my_project:
    [1]: data/my_seed.csv
Drag options to blanks, or click blank then click option'
Alocation
Bfile
Cpath
Dsource
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'file' or 'location' instead of 'path' causes dbt to not find the seed file.
2fill in blank
medium

Complete the command to load seeds into the data warehouse using dbt.

dbt
dbt [1]
Drag options to blanks, or click blank then click option'
Aseed
Bcompile
Cbuild
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'dbt run' instead of 'dbt seed' will not load seed files.
3fill in blank
hard

Fix the error in the seed configuration to enable header rows in the CSV file.

dbt
seeds:
  my_project:
    my_seed:
      [1]: true
Drag options to blanks, or click blank then click option'
Ainclude_header
Bheaders
Chas_header
Dheader
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'headers' or 'has_header' causes dbt to ignore the setting.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that loads seed data only for CSV files larger than 1MB.

dbt
large_seeds = {name: path for name, path in seeds.items() if [1]([2]) > 1048576 and [2].endswith('.csv')}
Drag options to blanks, or click blank then click option'
Aos.path.getsize
Bname
Cpath
Dlen
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'len' instead of 'os.path.getsize' for file size.
Using 'name' instead of 'path' to check file extension.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps seed names to their row counts, filtering seeds with more than 100 rows.

dbt
seed_row_counts = { [1]: sum(1 for _ in open([2])) - 1 for [3], _ in seeds.items() if sum(1 for _ in open(_) ) - 1 > 100 }
Drag options to blanks, or click blank then click option'
Aname
Bpath
Dfile
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'file' instead of 'path' to open the CSV.
Using inconsistent variable names causing errors.