mozilla / docker-etl

Collection of dockerized ETL jobs managed by data engineering.
Mozilla Public License 2.0
16 stars 14 forks source link

feat(fxci): add logic to automatically create tables with correct sch… #237

Closed ahal closed 2 months ago

ahal commented 2 months ago

…emas if they don't exist

This ended up being a bit more complicated than I wanted, but since I had all the types of the records defined in the dataclass, I didn't want to hard code them all a second time just for a BigQuery schema. So instead this uses the generate_schema function to automatically derive the table schema from the Record classes.

Was it worth doing this way? Probably not. But it works well, so I think it's worth keeping. This code can be re-used for future tables as well.

Checklist for reviewer: