Skip to content

Commit

Permalink
fix: constrain integer values to support maximum parquet type
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Apr 17, 2024
1 parent 39337e4 commit 2a68201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion silverback/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class _BaseDatapoint(BaseModel):
type: str # discriminator


# NOTE: Maximum supported parquet integer type: https://parquet.apache.org/docs/file-format/types
Int96 = Annotated[int, Field(ge=-(2**95), le=2**95 - 1)]
# NOTE: only these types of data are implicitly converted e.g. `{"something": 1, "else": 0.001}`
ScalarType = Union[bool, int, float, Decimal]
ScalarType = Union[bool, Int96, float, Decimal]


class ScalarDatapoint(_BaseDatapoint):
Expand Down

0 comments on commit 2a68201

Please sign in to comment.