← All work

Automated ETL Pipeline on GCP

Infosys Ltd, London · 2024
Apache AirflowCloud ComposerBigQueryPython
PDF
Case study
Live
Interactive demo
PDF
Pipeline Code Highlights
PNG
Architecture diagram
Airflow — data ingestion DAG running end-to-end.png
Airflow — data ingestion DAG running end-to-end.png

Case Study 4 — Automated ETL Pipeline on GCP Cloud Composer (Infosys)

Role: Data & AI InStep Intern · Company: Infosys Ltd, London · Duration: June – August 2024

Stack: Google Cloud Composer (managed Apache Airflow) · BigQuery · Google Cloud Storage · Python (pandas) · Google Cloud Shell

Deliverables: 5-DAG automated ETL pipeline · BigQuery curated + summary tables · architecture diagram · pipeline code

Built on a public video-game sales dataset, not client data. GCP project IDs and bucket names have been redacted in the published code excerpt.

The Problem

The team needed a repeatable, scheduled data-warehousing workflow on GCP — raw files landing in cloud storage, then cleaned, loaded and aggregated into BigQuery without anyone touching it manually. Doing this by hand doesn't scale: it's slow, inconsistent, and the moment someone forgets to run a step the downstream reporting is stale or wrong.

What I Built

An end-to-end automated ETL pipeline on Cloud Composer (Google's managed Apache Airflow), split into five DAGs so each stage is independently retryable and observable, running daily on a schedule:

#DAGWhat it does
1data_ingestion_dagReads the raw vgsales.csv from a GCS bucket and writes a combined dataset back to storage
2data_cleaning_dagDeduplicates and drops incomplete records, writing a processed_dataset.csv
3bigquery_dagLoads GCS → BigQuery via GCSToBigQueryOperator with an explicit 11-field schema and WRITE_TRUNCATE
4bigquery_vgsales_aggregation_dagRuns a CREATE OR REPLACE TABLE … AS SELECT to build a summary table aggregating sales by year and genre
5(environment DAG)Installs/pins the Python dependencies the workers need so tasks run reliably

16,598 raw records flow through ingestion → preprocessing → transformation → BigQuery load on every run. Cleaning drops 307 incomplete records, so 16,291 rows land in the curated table, and the aggregation builds a 389-row summary table grouped by year and genre. (De-duplication removes nothing on this particular source — it's already unique — but the step stays in the DAG so a future dirtier extract can't silently double-count.)

The Techniques

Engineering the pipeline to be reliable

Two engineering problems had to be solved for the pipeline to run dependably in a managed Airflow environment — both are the kind of thing that decides whether a pipeline survives production:

  1. Deterministic BigQuery loading. Relying on schema autodetect makes ingestion fragile — column types drift and loads reject rows. I defined the schema explicitly in the operator (all 11 fields typed and moded) and used WRITE_TRUNCATE, which made every load validated and idempotent. I then added pre-aggregated summary tables so downstream queries read clean, typed columns instead of scanning raw data.
  2. Reproducible worker dependencies. Cloud Composer workers need their Python libraries provisioned reliably or tasks fail to import. I handled this by developing installation scripts in Google Cloud Shell, uploading them to Cloud Storage, and executing them through Airflow — with dedicated install_pandas / install_airflow tasks in the DAG and custom test scripts to verify module versions.

Throughout, I kept my manager and stakeholders updated on progress and risks early, with root causes and a mitigation plan, rather than surfacing problems late.

The Impact

What's in this case study

Skills demonstrated: data engineering · Apache Airflow / Cloud Composer orchestration · ETL pipeline design · BigQuery schema design & SQL aggregation · Google Cloud Storage · Python (pandas) · data cleaning & QA (deduplication, type casting, schema validation) · debugging & dependency management · query optimisation · risk communication with stakeholders.