1. 학습
  2. /
  3. 강의
  4. /
  5. Scaling and Optimizing Data Pipelines with Polars

Connected

연습 문제

Inserting missing columns

One year's extracted file is missing the pub column (publisher), but the team still wants to scan both files as one dataset. Pick the right argument so Polars inserts null where a column is missing instead of failing.

polars is loaded as pl, and the directory is in DRIFT_DIR. The header of each file is printed for you, so you can see the schema difference.

지침

100 XP
  • Use a glob pattern to scan every seattle_*.csv file in DRIFT_DIR.
  • Add the right argument so Polars inserts nulls for columns that are missing in some files.