feat(data-warehouse): add facade and route consumers through it#66213
Open
Gilbert09 wants to merge 3 commits into
Open
feat(data-warehouse): add facade and route consumers through it#66213Gilbert09 wants to merge 3 commits into
Gilbert09 wants to merge 3 commits into
Conversation
Light submodules (facade.sources constants, facade.models, facade.hogql sync-status, facade.tasks beat task, facade.dags Dagster assets) + heavy facade.api (temporal schedule/s3/reconcile/webhook ops, off the setup path). Adds data_warehouse to the canonical [[interfaces]] block + a legacy-leak for the test helpers. Resolves the ws<->dw cycle by routing it through the facade.
👀 Auto-assigned reviewersThese soft owners were skipped because they only have minor changes here. Nothing blocks merge, so self-assign if you'd like a look:
Soft owners come from |
sakce
approved these changes
Jun 25, 2026
Contributor
|
Reviews (1): Last reviewed commit: "feat(data-warehouse): add facade and enf..." | Re-trigger Greptile |
facade.api eagerly imported logic.data_load -> warehouse_sources -> facade.api (circular import via the ws<->dw cycle). Make it a PEP 562 lazy aggregator so names resolve on first access, breaking the import-time cycle (and keeping it off the setup path). Move data_warehouse to a dedicated [[interfaces]] block (the canonical alternation requires facade/contracts.py, which the operational-wiring facade doesn't have yet).
Contributor
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
Contributor
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Phase 2 isolates
data_warehousebehind a facade. The structural prereqs landed in #66128; this PR adds the facade itself and routes external consumers through it. Critically, it resolves the warehouse_sources ↔ data_warehouse cycle:warehouse_sources(isolated in Phase 1) importsdata_warehouseinternals (logic.data_load,s3, the direct-SQL constants, webhook consumer) — those now go throughdata_warehouse's facade.Changes
backend/facade/), split by import weight so setup-path consumers stay light:sources.py— direct-SQL option constants (consumed by the setup-pathwarehouse_sourcestable model).models.py—ExternalDataSourceRevenueAnalyticsConfig.hogql.py—get_warehouse_sync_warnings(the HogQL database builder, setup-adjacent).tasks.py— the beat-scheduled digest catch-up task.dags.py— themanaged_viewset_syncDagster asset module (the rootdags/channel the scan can't see).api.py— the heavy operational surface (temporal schedule/workflow management, S3 helpers, schema reconciliation, job-status updates, webhook ingestion). Off thedjango.setup()path; its consumers are the temporal workers / import pipeline.posthog/temporal, data_modeling, endpoints, signals, hogql, dags, admin) repointed offdata_warehouseinternals onto the facade. Identity-preserving.data_warehouseadded to the canonical[[interfaces]]block (tach check --interfacesnow enforces facade-only access) + a small legacy-leak for the test helpers core still imports.Deferred (future Phase 2 PRs)
facade/api.pyis re-exports, not model→contract functions (product:lint notes this as a non-blocking warning in lenient mode). Contract-data functions +contracts.pycome with the presentation wave.backend:contract-checkis the final flip once all leaks are gone.How did you test this code?
Automated, run locally:
tach check --dependencies --interfaces→ All modules validated (data_warehouse enforced as an interface; the Dagster channel rerouted throughfacade.dags).lint-imports→ presentation contract KEPT.hogli product:lint data_warehouse→ exit 0 (expected lenient-mode warnings: legacy-leak + re-export facade).table.py/database.pyoff the heavy temporal/s3 path).ruff+py_compileclean on all 52 changed files.Behavioral product tests run in CI (the sweep is identity-preserving).
Docs update
No user-facing docs changes.