feat: Add default value for index field in DuckDbMessageModel

This commit adds a default value of `None` for the `index` field in the `DuckDbMessageModel` class. The default value is set using the `Field` class from the `pydantic` library, with the `default` parameter set to `None` and the `alias` parameter set to "index". This change ensures that the `index` field is optional and can be omitted when creating instances of the `DuckDbMessageModel` class.

Note: The commit message has been generated based on the provided code changes and recent commits.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-26 19:56:21 -03:00
commit e9091b9946

View file

@ -82,7 +82,7 @@ class TransactionModelResponse(DefaultModel):
class DuckDbMessageModel(DefaultModel):
index: int
index: int | None = Field(default=None, alias="index")
flow_id: str | None = Field(default=None, alias="flow_id")
timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
sender: str