Cleaning must not change the business
The R$ 102 million in revenue reconciles exactly from bronze to gold. Data quality tests fail the pipeline when anything diverges. The rule is to fix the transformation, never the test.
Case study
A Databricks lakehouse that turns 10 ERP and CRM CSV files into a weekly queue of 200 sales calls, right on the director's screen.
Fictional distributor. The data was generated for this study, in the shape it takes at real companies.
The starting point was 10 ERP and CRM CSV files with over 300,000 rows. Dates in two formats in the same column. Company tax IDs (CNPJ) with stray spaces. Duplicates. The kind of mess that breaks reports and, worse, breaks decisions.
The answer was a layered pipeline (raw, bronze, silver, gold), defined entirely as code with Databricks Asset Bundles. Schemas, jobs, the dashboard and the Genie spaces are versioned and ship in the same deployment.
The R$ 102 million in revenue reconciles exactly from bronze to gold. Data quality tests fail the pipeline when anything diverges. The rule is to fix the transformation, never the test.
Every column an AI queries has an audited business comment. A job task fails if one is missing. That is what makes Genie answer "how much is the queue worth?" with the right number and the word "estimate".
A purchase propensity model (scikit-learn and MLflow, 4x lift over a random queue) feeds the weekly queue. The team logs the outcome of every contact in the React Databricks App. In the first week, actual conversion was 41.7%, against the 41.5% the model predicted.
Three tabs (the app itself is in Portuguese): this week (who to call), tracking (whether the model holds up) and ask (Genie, running with the user's own Unity Catalog permissions).
The same metadata contract answers outside the app, in the Databricks Genie space. A business question becomes a number you can verify.
The rotaperfume-direcao app is deployed with Databricks Asset Bundles. The serverless warehouse, the Genie space and the React front end ship in the same bundle.
The project is still evolving. The next steps are extracting the transformations into Python modules that can be tested outside the notebook, and moving infrastructure provisioning to Terraform, so the same environment can be reproduced in any workspace.