Defining the schema
Let's start by defining the expected schema for data validation. This is a critical step in ensuring data quality throughout the ETL pipeline.
You'll use the pointblank library to define the schema structure.
The dataset has already been loaded for you as ts.
本练习是课程的一部分
Designing Forecasting Pipelines for Production
练习说明
- Start by importing
pointblank. - Define the schema using the right method.
- Set the
respondentcolumn toobjecttype andvaluecolumn tofloat64type.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Import the required library
import ____ as ____
# Define the schema and set columns
table_schema = pb.____(
columns=[
("period", "datetime64[ns]"),
("respondent", "____"),
("respondent-name", "object"),
("type", "object"),
("type-name", "object"),
("value", "____"),
("value-units", "object")])
print(table_schema)