______________
- Engine:
- This release adopts `pydantic` as a the library for dataclasses and schema validation
BREAKING CHANGES
================
- Python `dataclasses.dataclass` is no longer supported in `dataobjects` annotated classes.
Pydantic `dataclasses` (and in the future BaseModel should be used).
- The recommended way is to import from dataobjects module:
from hopeit.dataobjects import dataclass, dataobject, field
where dataclass and field are aliases of `pydantic.dataclasses.dataclass` and `pydantic.Field`
- In most of the cases replacing the import clause in applications should suffice,
but could be features of dataclasses that should be replaced by its
equivalent in `pydantic`.
- For cases where you store data in the field property metadata, you can access it as follows:
from hopeit.dataobjects import dataclass, dataobject, field
dataobject
dataclass
class User:
name: str = field(metadata={"key": "value"})
metadata = User.name.json_schema_extra["metadata"]
- Plugins:
- Dataframes
- Made it compatible with pydantic dataclasses
- Removed `dataframeobject` annotation in favor of Dataset[T] generic type
- Introduced `.DataObject` companion type for `dataframe` conversion to `DataObject`