Models¶
Pydantic models returned by the SDK.
Team¶
Represents a team that owns assets or consumes contracts.
Example:
team = client.teams.get("team-uuid")
print(team.id) # UUID
print(team.name) # "data-platform"
print(team.description) # "Data platform team"
print(team.created_at) # datetime
Asset¶
Represents a data asset (table, view, model).
class Asset:
id: UUID
fqn: str
owner_team_id: UUID
description: str | None
created_at: datetime
current_contract_id: UUID | None
Example:
asset = client.assets.get("asset-uuid")
print(asset.fqn) # "warehouse.analytics.dim_customers"
print(asset.owner_team_id) # UUID
print(asset.current_contract_id) # UUID of active contract
Contract¶
Represents a data contract defining the schema.
class Contract:
id: UUID
asset_id: UUID
version: str
schema: dict
compatibility_mode: str
status: str # "active", "deprecated", "superseded"
created_at: datetime
deprecated_at: datetime | None
Example:
contract = client.contracts.get("contract-uuid")
print(contract.version) # "1.0.0"
print(contract.schema) # {"type": "object", ...}
print(contract.compatibility_mode) # "backward"
print(contract.status) # "active"
Registration¶
Represents a team's registration to consume a contract.
Example:
registration = client.registrations.get("registration-uuid")
print(registration.contract_id) # UUID
print(registration.consumer_team_id) # UUID
Proposal¶
Represents a proposal for a breaking change.
class Proposal:
id: UUID
asset_id: UUID
proposed_schema: dict
proposed_version: str
breaking_changes: list[str]
status: str # "pending", "approved", "rejected", "expired"
created_at: datetime
resolved_at: datetime | None
Example:
proposal = client.proposals.get("proposal-uuid")
print(proposal.status) # "pending"
print(proposal.breaking_changes) # ["Removed required field 'email'"]
Acknowledgment¶
Represents a team's acknowledgment of a proposal.
class Acknowledgment:
id: UUID
proposal_id: UUID
team_id: UUID
accepted: bool
comment: str | None
created_at: datetime
PublishResult¶
Returned by assets.publish_contract().
class PublishResult:
published: bool
contract: Contract | None # Set if published=True
proposal: Proposal | None # Set if published=False (breaking change)
Example:
result = client.assets.publish_contract(...)
if result.published:
print(f"Published contract: {result.contract.id}")
else:
print(f"Breaking change, proposal: {result.proposal.id}")
ImpactResult¶
Returned by assets.check_impact().
class ImpactResult:
safe_to_publish: bool
breaking_changes: list[str]
affected_registrations: list[Registration]
Example:
impact = client.assets.check_impact(
asset_id="asset-uuid",
proposed_schema={...}
)
if not impact.safe_to_publish:
print("Breaking changes detected:")
for change in impact.breaking_changes:
print(f" - {change}")
print("Affected consumers:")
for reg in impact.affected_registrations:
print(f" - Team {reg.consumer_team_id}")
CompareResult¶
Returned by contracts.compare().
Example: