Skip to main content

pandera plugin for flyte

Project description

Flyte Pandera Plugin

flyteplugins-pandera adds support for pandera.typing.pandas.DataFrame, pandera.typing.polars.DataFrame / LazyFrame, and pandera.typing.pyspark_sql.DataFrame in Flyte v2.

Install:

pip install flyteplugins-pandera 'pandera[pandas]'            # pandas only
pip install flyteplugins-pandera 'pandera[polars]' flyteplugins-polars   # Polars + structured dataset I/O
pip install flyteplugins-pandera 'pandera[pyspark]' flyteplugins-spark     # PySpark SQL + parquet I/O

For PySpark, structured dataset serialization uses Flyte’s DataFrameTransformerEngine parquet handlers from flyteplugins-spark (register Spark encoders/decoders alongside this plugin).

At runtime, the plugin:

  1. delegates dataframe IO to Flyte's DataFrameTransformerEngine,
  2. validates data with pandera schemas, and
  3. writes a validation report to flyte.report.

Validation always runs on every encode/decode. Report tabs are suppressed automatically when Flyte is only moving literals across a nested-task boundary (parent task encoding child inputs, or materializing a child’s outputs inside the parent). The SDK sets TaskContext.in_driver_literal_conversion on the active task (check with flyte.ctx() when non-None, then .in_driver_literal_conversion) so you see one report per dataframe on the task that actually produced or consumed it as task body I/O, not extra tabs on the orchestrating “driver” task.

Troubleshooting

If logs show “Unsupported Type pandera.typing… Flyte will default to use PickleFile”, the pandera transformer was not registered:

  • Install the plugin in every environment (local runner and task image): pip install flyteplugins-pandera.
  • Flyte loads flyte.plugins.types during flyte.initialize() and on first TypeEngine use; confirm the distribution is installed (import importlib.metadata as m; print(list(m.entry_points(group="flyte.plugins.types")))).
  • Import order: import your pandera.typing.* modules before plugin registration runs in files that run early (tests, __init__.py). Loading the plugin before pandera can leave two different pandera.typing.pandas.DataFrame (or polars container) class objects in the process; TypeEngine would only know about one of them, so annotations on the other fall through to pickle / the generic handler.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flyteplugins_pandera-2.3.0b0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file flyteplugins_pandera-2.3.0b0-py3-none-any.whl.

File metadata

File hashes

Hashes for flyteplugins_pandera-2.3.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 03c23746e63284605a8c2d64b5c41821e2f3536e7a7795522fc805425e4caeb1
MD5 e94fabcfc2f50a8f2333ed4f5dd58532
BLAKE2b-256 26c0d9055d0ab059deb1af08864f91becca478d4b694c8ba7fbb1c0086a40199

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page