Skip to content

hopeit.engine 0.25.0

Latest
Compare
Choose a tag to compare
@pcanto-hopeit pcanto-hopeit released this 07 Aug 18:16
398852e

Version 0.25.0


  • Engine:

    • This release adopts pydantic as a the library for dataclasses and schema validation

    • StreamManager: add support for username and password in StreamsConfig

    • Fix: support for empty values in environment variables used in config files

    BREAKING CHANGES

    • Dropped support for Python 3.8

    • 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 (like i.e. metadata) that should be replaced by its
      equivalent in pydantic.

    • API validation: now payload validation is not done in api module and is deferred and done by pydantic when the
      payload is being parsed. Response in case of validation error will return BadRequest (400) but with
      different error message than in previous versions.

  • 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
      • Fixed type coercion for string fields
      • Datetime fields are converted to UTC when dataframe object is initialized
    • redis-streams: update StreamsConfig usage to support new username and password fields

    • redis-storage: add support for username and password in the connect method

  • Development (internal)

    • Simplified and accelerated linting using ruff. Dropping pylint and flake
    • Reformatted code files
    • Moved linting and test logic to Makefile