pandera-polars
Use for writing, reviewing, debugging, or testing Pandera schemas and runtime validation for Polars DataFrame or LazyFrame pipelines installed with…
от skillmds★ 42 звезды на GitHub
Установить pandera-polars в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Pandera for Polars
Create executable Polars dataframe contracts whose backend, validation depth, coercion, failure aggregation, and pipeline boundary are explicit.
Boundary
Use this skill only for Pandera's Polars backend. Import it as
pandera.polars; pandas, Ibis, PySpark, and Narwhals-backed behavior differs.
Use the Polars skill for transformation semantics and this skill for runtime
dataframe contracts. Do not replace ordinary Python object validation with a
one-row dataframe schema.
Know the objects and overloaded words
| Object | Runtime meaning | Use it for |
|---|---|---|
DataFrameSchema |
An executable schema object containing Polars column and dataframe checks. | Dynamic/programmatic schemas and schema composition. |
Column |
A named column contract: dtype, nullability, requirement, uniqueness, coercion, and checks. | Per-column structural and value rules. |
Check |
A predicate contract evaluated by the backend. | Domain constraints not captured by dtype/nullability. |
DataFrameModel |
A class-declared schema compiled from annotations, Fields, checks, and config. |
Reusable named contracts with type-checker-friendly declarations. |
Field |
Declarative column constraints inside a DataFrameModel. |
Built-in comparisons, membership, aliases, nullable/unique behavior. |
PolarsData |
Custom-check input holding a LazyFrame and optional column key. |
Native vectorized Polars checks. |
SchemaError / SchemaErrors |
One validation failure or an aggregate of failures. | Machine-readable failure handling and diagnostics. |
Two kinds of “lazy” must remain separate:
pl.LazyFrameis a deferred Polars query. Pandera's native Polars validation checks schema-level properties by default and does not automatically execute all data-level checks on an uncollected plan.schema.validate(..., lazy=True)requests accumulation of multiple validation failures before raising; it does not make eager validation computationally lazy.
Read the schema and validation model before choosing a schema style or claiming that values were checked.
Ordered workflow
- Recover the data contract: accepted frame type, ordered/required columns, exact dtypes, nullable fields, uniqueness, extra-column policy, allowed coercions, cross-column invariants, and failure interface.
- Import
pandera.polars as pa. Confirm the installed Pandera and Polars versions before copying a backend feature or signature. - Choose
DataFrameSchemafor dynamic composition orDataFrameModelfor a stable named contract. Do not maintain both as independent sources of truth. - Encode structural rules first, then built-in vectorized checks, then the smallest native custom check that remains.
- Choose validation depth from the input object. If data-level checks are
required for a
LazyFrame, collect or otherwise establish a supported execution boundary; do not report schema-only validation as full validation. - Choose
coerce,strict, andlazyindependently. Each changes a different contract. - Validate at ingress, after an untrusted/shape-changing stage, or before egress—not after every expression by habit.
- Test one failure for every rule and inspect
failure_cases/error categories, not exception prose alone.
Decision table
| Need | Use | Do not confuse it with |
|---|---|---|
| Programmatic/reusable schema value | pa.DataFrameSchema |
A Python class instance model. |
| Declarative named dataframe contract | pa.DataFrameModel |
Pydantic BaseModel. |
| Reject unspecified columns | strict=True |
required=True, which concerns declared columns. |
| Drop unspecified columns intentionally | Installed strict="filter" support |
Silent schema drift; test passthrough loss. |
| Convert compatible inputs | coerce=True at the chosen scope |
Validation-only behavior; coercion mutates the returned representation. |
| Gather all failures | validate(..., lazy=True) |
A Polars LazyFrame. |
| Vectorized custom column rule | Check receiving PolarsData and returning Boolean LazyFrame output |
Python element callbacks. |
| Cross-column invariant | Dataframe-level native check | A column check that cannot see the needed peer fields. |
Read the operation map for schemas, models, checks, decorators, and pipeline placement.
Canonical strict contract
import pandera.polars as pa
import polars as pl
ORDERS = pa.DataFrameSchema(
{
"order_id": pa.Column(
pl.Int64,
checks=pa.Check.ge(1),
nullable=False,
unique=True,
),
"country": pa.Column(
pl.String,
checks=pa.Check.isin(["DE", "FR", "NL"]),
nullable=False,
),
"amount": pa.Column(
pl.Float64,
checks=pa.Check.ge(0),
nullable=True,
),
},
strict=True,
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/object-model.md
- references/operations.md
- references/testing.md
- references/version-grounding.md
- scripts/inspect_pandera_polars.py
FAQ
Что делает скилл pandera-polars?
Use for writing, reviewing, debugging, or testing Pandera schemas and runtime validation for Polars DataFrame or LazyFrame pipelines installed with pandera[polars]. Trigger on pandera.polars DataFrameSchema, DataFrameModel, Column, Field, Check, PolarsData, decorators, coercion, strictness, lazy error collection, and validation-depth decisions. Do not use for pandas-backed Pandera, Pydantic object models, Polars transformations without Pandera, static dataframe typing alone, or generic data-quality platforms.
Как установить скилл pandera-polars?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pandera-polars запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…