Adapt Data Ingestion
Target file: notebooks/1_data_preprocessing/data_ingestion.ipynb
Target job: resources/1_data_preprocessing_job.yml
When to use
Use this skill whenever the user wants to:
- Replace the Iris dataset with their own source data.
- Add preprocessing stages (bronze → silver → gold).
- Rename the feature table or change its schema/primary key.
Step-by-step
Replace the data source. Remove the
sklearn.datasets.load_iris()block. Replace with the customer's data source — for example:- Cloud storage:
spark.read.format("parquet").load("s3://..."),dbutils.fs.ls+ Auto Loader, etc. - JDBC:
spark.read.format("jdbc").options(...).load(). - REST API: pull with
requeststhenspark.createDataFrame(...). - Existing Delta table:
spark.read.table("...").
- Cloud storage:
Rename the feature table. Replace
iris_datawith a meaningful name (e.g.customer_churn_features). Keep the three-level reference{catalog_name}.{schema_name}.<table_name>— never hardcode catalog or schema.Adjust the schema. Update column casts, primary key constraints, and any column-level transformations to match the new dataset.
Preserve idempotency. Keep the "table exists?" guard so the notebook can safely re-run. Decide deliberately between
overwriteandappendfor the new use case.Add multi-stage preprocessing (optional). For bronze → silver → gold pipelines:
- Add notebooks under
notebooks/1_data_preprocessing/(e.g.1_bronze_ingestion.ipynb,2_silver_cleaning.ipynb,3_gold_features.ipynb). - Add corresponding
tasksinresources/1_data_preprocessing_job.yml, wiringdepends_onto enforce execution order. - Pass
catalog_name/schema_nameto each new task viabase_parameters.
- Add notebooks under
Update the job notification email. Replace
your.name@address.cominresources/1_data_preprocessing_job.ymlwith the team's address.
Parameterization contract
Every new notebook must define widgets for catalog_name and schema_name
and reference all tables as {catalog_name}.{schema_name}.<object>. See the
mlops-quickstart-overview skill for the full contract.
Edge cases
- Streaming sources (Kafka, Kinesis, Auto Loader): keep ingestion in a separate notebook and configure the job task as a continuous trigger if needed.
- Large datasets: prefer Auto Loader over
spark.readfor incremental cloud-storage ingestion. - Sensitive columns: apply column masks or row filters via Unity Catalog rather than dropping them in the notebook, so governance is centralized.
- Schema drift: if the source schema may evolve, enable
mergeSchema(.option("mergeSchema", "true")) and document the decision in the notebook.