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

Connected

연습 문제

Overriding the inferred schema

When Polars scans the vendor export, it uses the first few rows to infer column types. The branch_code column uses 3-digit identifiers with leading zeros ("001", "002", …), but Polars sees integers and parses them as Int64, silently dropping the zeros. Override the schema so branch_code stays a string.

The inferred schema is already printed for you, so you can see what Polars guessed without any overrides.

지침

100 XP
  • Override branch_code so it's read as pl.String.