<#1620 Feat: Add pydantic plugin with `BaseModel` ...
# flyte-github
a
#1620 Feat: Add pydantic plugin with `BaseModel` type transformer Pull request opened by fg91 on <!date^1683290781^{date_short}|2023-05-05T12:46:21Z> TL;DR The plugin adds type support for pydantic
BaseModel
. Type ☐ Bug Fix ☐ Feature ☑︎ Plugin Are all requirements met? ☐ Code completed: The transformer does not yet support all Flyte types in a pydantic model (e.g. data frames) ☑︎ Smoke tested ☑︎ Unit tests added ☐ Code documentation added ☐ Any pending items have an associated Issue Complete description The plugin allows passing pydantic models to and between tasks: Type Example
Copy code
from pydantic import BaseModel
import flytekitplugins.pydantic
class Config(BaseModel):
    lr: float = 1e-3
    batch_size: int = 32
@task
def train(cfg: Config):
    ...
Tracking Issue flyteorg/flyte#2686 Follow-up issue NA flyteorg/flytekit Codecov: 70.10% (-0.01%) compared to baf0b89 29 other checks have passed 29/30 successful checks