Managed Warehouse Boundary Contracts (facade/contracts.py)

posthog · products/managed_warehouse/backend/facade/contracts.py · python · MIT
auth, database, pos, lang:python, tag:dataclasses, tag:contracts

Defines pure Python data and error types for the managed warehouse subsystem without external framework dependencies. Use to share contracts safely across boundaries.

# Source: https://github.com/PostHog/posthog | License: MIT | Copyright 2020-2026 PostHog Inc
# Provided via justclaw.it.com; keep this notice with the code.
"""
Data and error types that cross the managed_warehouse boundary.

Pure Python — no Django, no DRF, no duckdb — so consumers can import these without
dragging the product's runtime onto their import path. The product's internals import
them from here too, so there is exactly one definition of each.

These stay plain ``dataclass`` rather than ``pydantic.dataclasses.dataclass``: they
carry query results on a hot path, and per-row validation on construction would be a
behavior change, not a contract improvement.
"""

from __future__ import annotations

from dataclasses import dataclass, field
from datetime import date, datetime
from en

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key