Validate representative data locally
Run schemas and quality rules with Polars or DuckDB before paying the startup cost of a remote Spark environment.
Define schemas, quality rules and materialization once. Validate locally, check contract changes in CI, and run governed pipelines with Polars, DuckDB or Spark.
# Business expectations as code model: fields: - name: order_id type: integer required: true - name: amount type: float required: true quality: row_rules: - name: positive_amount sql: "amount > 0"
Stop rebuilding the same controls in every pipeline. LakeLogic turns version-controlled contracts into executable validation, quarantine and materialization behaviour while complex transformations remain normal Python or SQL.
Polars and DuckDB are included. Add the Spark extra when you need distributed lakehouse execution.
pip install lakelogicpip install "lakelogic[spark]"Run schemas and quality rules with Polars or DuckDB before paying the startup cost of a remote Spark environment.
Use configured gates to identify breaking schemas, missing PII declarations and lineage changes before deployment. Some gates require comparison context.
Separate accepted and failed records, preserve diagnostic context, and stop downstream work when dataset-level thresholds are breached.
Engine boundaries matter. The contract model is shared, but engines and catalog combinations are not identical. Review the capability matrix before choosing Spark, Polars, DuckDB, Delta or Iceberg.
RideFlow is a fictional business used to demonstrate domain-owned data products on Databricks Unity Catalog. The repository shows contracts, Bronze–Silver–Gold flows, quarantine, lineage, SCD Type 2 and cross-domain dependencies.
Independent domain products use common contract machinery without claiming that YAML alone creates organisational ownership or platform governance.
infer_contract() can inspect a supported file or table sample and return a draft with fields, types and suggested rules. The draft remains reviewable YAML—not an invisible production decision.
PII detection and AI-assisted descriptions are optional capabilities with additional dependencies or configured providers.
from lakelogic import infer_contract draft = infer_contract( "data/orders.csv", title="Orders Bronze", suggest_rules=True, ) draft.show() draft.save("contracts/orders.yaml")
Put schemas, quality rules, ownership metadata and service expectations beside the code that produces the dataset.
Reuse contract machinery across teams while domains retain responsibility for business meaning and product changes.
Let AI assist with drafts or proposed changes, then use explicit contracts, review and runtime gates to control what executes.
How shared contract intent can reduce logic drift while respecting engine-specific boundaries.
Read → ReliabilityRetain failed records with evidence instead of silently discarding them or losing the whole run.
Read → ContractsSchema checks shape. Contracts can also express quality, ownership, service expectations and outputs.
Read →Open the quickstart, inspect the accepted and failed records, then decide whether LakeLogic fits your pipeline.