unstale

pypi / polyfactory

polyfactory

What changed in polyfactory 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.

1 breaking3 new APIs and options1 behavior and defaults10 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.4 on npm

polyfactory 315 changes

Breaking changes 1

  • Default values are no longer fetched from TypedDict models.

    3.4.0release notes

New APIs and options 3

  • __use_examples__ is now supported in all factories.

    3.4.0release notes

  • Adds __persistence__method__ to SQLAlchemyFactory.

    3.3.0release notes

  • Adds support for SQLAlchemy computed fields.

    3.3.0release notes

Behavior and default changes 1

  • The session lifecycle is managed when a session is created implicitly.

    3.4.0release notes

Fixes and other changes 10

  • Pydantic factories now respect __by_name__ when fields define Field(alias=...).

    3.5.0release notes

  • Adds support for Python 3.15.

    3.5.0release notes

  • The by_name keyword argument is guarded for pydantic versions earlier than 2.11.

    3.4.0release notes

  • Timezone handling for end_date is fixed.

    3.4.0release notes

  • Date constraint handling now handles bool tz constraints from msgspec.Meta.

    3.4.0release notes

  • Resolution order now favours provider types.

    3.4.0release notes

  • Pydantic examples in nested type annotations are now supported.

    3.4.0release notes

  • More supporting BaseFactories are found for unsupported types.

    3.4.0release notes

  • TypedDictFactory now supports ReadOnly fields.

    3.4.0release notes

  • Leaves the async session opened after persisting data.

    3.3.0release notes