Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions _freeze/index/execute-results/html.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions _freeze/reference/Validate/execute-results/html.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pointblank/adapters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import pointblank.adapters._frictionless # noqa: F401

# Import adapter modules to trigger registration via @register_adapter
import pointblank.adapters._dbt # noqa: F401
import pointblank.adapters._frictionless # noqa: F401
import pointblank.adapters._json_schema # noqa: F401
import pointblank.adapters._odcs # noqa: F401
from pointblank.adapters._api import export_contract, import_contract
from pointblank.adapters._base import ContractAdapter, ContractImport, MappedConstraint
from pointblank.adapters._registry import (
Expand Down
16 changes: 7 additions & 9 deletions pointblank/adapters/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@
def import_contract(source: Any, *, format: str | None = None, **kwargs: Any) -> ContractImport:
"""Import a contract/schema from an external format.

Reads an external schema definition (JSON Schema, Frictionless Table Schema, dbt schema.yml,
Pandera schema, Pydantic model, etc.) and produces a `ContractImport` with validation steps
mapped to Pointblank methods.
Reads an external schema definition and produces a `ContractImport` with validation steps
mapped to Pointblank methods. Use `pb.list_adapters()` to see all registered formats.

Parameters
----------
source
The source to import from. Can be: (1) a file path (str) to a schema/contract file, (2) a
Python dict with schema content already loaded, or (3) a Python object (e.g., a Pandera
`DataFrameSchema` or Pydantic model class).
The source to import from. Can be: (1) a file path (str) to a schema/contract file, or
(2) a Python dict with schema content already loaded.
format
The format identifier (e.g., `"json_schema"`, `"frictionless"`, `"dbt"`, etc.). If `None`,
the format is auto-detected from file extension or content.
The format identifier (e.g., `"json_schema"`, `"frictionless"`, `"dbt"`, `"odcs"`). If
`None`, the format is auto-detected from file extension or content.
**kwargs
Format-specific options passed to the adapter.

Expand Down Expand Up @@ -87,7 +85,7 @@ def export_contract(
Optional file path to write the output. If None, the result is returned without writing to
disk.
format
The target format identifier (e.g., `"json_schema"`, `"frictionless"`, `"dbt"`, etc.).
The target format identifier (e.g., `"json_schema"`, `"frictionless"`, `"dbt"`, `"odcs"`).
**kwargs
Format-specific options passed to the adapter.

Expand Down
Loading
Loading