Skip to content

Migrating From 0.3⚓︎

Talika 0.4 makes two boundaries explicit: a typed field must describe every value Talika can create, and output conversion happens through parse_as(). Most schemas need only small, local edits.

Make Typed Fields Consistent⚓︎

Before, a typed field could be optional even when its annotation rejected None or raw blank text:

Before
class UserTable(RowTable):
    age: int = field("Age")

If the field is required, say so:

After: required
class UserTable(RowTable):
    age: int = field("Age", required=True)

If it is optional, allow None and choose the blank policy:

After: optional
class UserTable(RowTable):
    age: int | None = field("Age", empty="none")

Unsupported annotations such as list[str] now require an explicit parser. Static defaults must match resolvable annotations. Explicit custom parsers and default factories remain trusted.

Split Parsing From Output Conversion⚓︎

In 0.3, parse() could return either records or configured output models, and parse_records() forced the record form:

Before
users = UserTable.parse(datatable)
records = UserTable.parse_records(datatable)

In 0.4, parse() always returns schema records. parse_as() performs output conversion:

After
records = UserTable.parse(datatable)
users = UserTable.parse_as(datatable)

parse_records(), parse_table_records(), and the pytest fixture's parse_records() method were removed. Their direct replacement is parse().

You may also pass a dataclass, Pydantic model, or other callable for one call:

Explicit output target
users = UserTable.parse_as(datatable, User)

An explicit target overrides configured schema and variant output hooks.

Required Fields Own Blank Input⚓︎

In 0.3, an empty-aware parser could make a required blank succeed:

Before
value = field(required=True, parser=optional(integer()))

In 0.4, required blanks always raise empty_required. Optional fields send a blank to their parser only with empty="parse":

After
value: int = field(required=True)
optional_value: int | None = field(empty="parse")

Check The Result⚓︎

Run the test suite after updating schema definitions. Schema-definition errors name the conflicting field path and suggest a concrete correction. Then update type-checking samples so parse() is list[SchemaType] and explicit parse_as(..., OutputType) is list[OutputType].