Skip to content

About

Resilient telecom ETL pipeline built with Python, Mage, GCP, and BigQuery.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Telecom Data Revolution

A production-style batch ETL platform that ingests telecom churn data, enforces data contracts, quarantines invalid records, builds analytics-ready datasets, and loads them into Google BigQuery through Mage.

Project status

Phase 3 is complete and verified end to end.

Result Verified value
Raw records 243,553
Curated records 223,966
Quarantined records 19,587
Validity rate 91.96%
BigQuery audit runs 2
Automated tests 31

The source dataset is intentionally excluded from Git. The repository contains the pipeline code, schemas, tests, documentation, and reproducible setup files.

Architecture

telecom_churn.csv
        |
        v
Mage: load_telecom_data
        |
        v
Schema and quality validation
        |---------------------------|
        v                           v
Valid records                  Invalid records
        |                           |
        v                           v
Analytics transformation       Quarantine + issue codes
        |                           |
        |-------------|-------------|
                      v
                 Google BigQuery
                      |
          |-----------|-------------|
          v           v             v
    customer_churn  quarantine  pipeline_audit

Core transformation logic lives in src/telecom_pipeline. Mage blocks delegate to that package, keeping orchestration separate from testable business logic.

Engineering features

  • Explicit schema and data-contract validation
  • Record-level quarantine with quality issue codes
  • Missing-file and empty-dataset exceptions
  • Deterministic, idempotent full-refresh loading
  • BigQuery schemas, clustering, and load-time partitioning
  • BigQuery Sandbox-safe retention for historical registrations
  • Append-only pipeline audit records
  • Application Default Credentials instead of committed cloud keys
  • Unit tests, Ruff linting, and Black formatting

BigQuery model

Table Purpose Write strategy
customer_churn Curated analytics-ready customer data WRITE_TRUNCATE
customer_churn_quarantine Rejected records and quality issues WRITE_TRUNCATE
pipeline_audit Source counts, validity rate, status, and timestamp WRITE_APPEND

customer_churn is partitioned by loaded_at, rather than the historical registration date. This prevents BigQuery Sandbox from immediately expiring old registration-date partitions.

Repository structure

telecom-data-revolution/
|-- data/                       # Ignored raw, processed, and quarantine data
|-- docs/                       # Architecture, profiling, dictionary, runbooks
|-- scripts/                    # Profiling, preflight, deployment, verification
|-- sql/                        # BigQuery DDL and analytics SQL
|-- src/telecom_pipeline/       # Reusable ETL package
|-- telecom_pipeline/           # Mage project and orchestration blocks
|-- tests/                      # Unit, integration, and quality tests
|-- .env.example                # Safe configuration template
|-- pyproject.toml              # Python tooling configuration
`-- requirements.txt            # Known-good dependency versions

Local setup

Python 3.11 is the supported runtime for the pinned Mage environment.

python -m venv .venv
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt

Copy the configuration template:

Copy-Item .env.example .env

Set the real project ID and BigQuery settings in .env. Never commit .env, service-account keys, or Application Default Credential files.

Profile and validate the dataset

Place telecom_churn.csv in data/raw/, then run:

python scripts\profile_dataset.py

The profiler creates curated and quarantined artifacts locally while generating the data-quality report and dictionary used by the pipeline.

Deploy and run

Authenticate locally with Google Cloud Application Default Credentials, then:

python scripts\check_bigquery.py --require-ready
python scripts\deploy_bigquery.py
mage run telecom_pipeline telecom_etl_pipeline
python scripts\verify_bigquery_counts.py

Start the Mage interface when interactive development is needed:

mage start telecom_pipeline

Open http://127.0.0.1:6789.

Quality checks

ruff check src tests scripts telecom_pipeline\custom
black --check src tests scripts telecom_pipeline\custom
pytest
pip check

Security and data handling

  • .env, credentials, virtual environments, and local Mage metadata are ignored.
  • Raw, processed, and quarantined customer datasets are not committed.
  • Cloud authentication uses the local Google ADC store.
  • .env.example contains placeholders only.

Roadmap

  • Phase 4: analytical SQL views, churn KPIs, and dashboard-ready datasets
  • Phase 5: monitoring, scheduled execution, alerts, and CI/CD hardening
  • Optional: PostgreSQL as a second warehouse destination

Execution evidence

BigQuery verification on October 13, 2026 passed: 223,966 curated records, 19,587 quarantined records, and two pipeline audit records.

BigQuery verification results

About

Resilient telecom ETL pipeline built with Python, Mage, GCP, and BigQuery.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages