Skip to content

Commit

Permalink
query: add comment about serialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
yagebu committed Nov 9, 2024
1 parent 431c34e commit 744c221
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/fava/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from fava.core.conversion import simple_units

if TYPE_CHECKING: # pragma: no cover
from typing import Any
from typing import Literal
from typing import TypeAlias
from typing import TypeVar
Expand All @@ -22,9 +23,11 @@

T = TypeVar("T")

QueryRowValue = (
bool | int | str | datetime.date | Decimal | Position | Inventory
)
QueryRowValue = Any

# This is not a complete enumeration of all possible column types but just
# of the ones we pass in some specific serialisation to the frontend.
# Everything unknown will be stringified (by ObjectColumn).
SerialisedQueryRowValue = (
bool
| int
Expand Down Expand Up @@ -69,7 +72,7 @@ def serialise(
val: QueryRowValue,
) -> SerialisedQueryRowValue:
"""Serialiseable version of the column value."""
return val # type: ignore[return-value]
return val # type: ignore[no-any-return]


@dataclass(frozen=True)
Expand Down

0 comments on commit 744c221

Please sign in to comment.