|
16 | 16 | import uuid |
17 | 17 | from collections.abc import Collection, Iterator, Mapping |
18 | 18 | from dataclasses import dataclass |
19 | | -from datetime import datetime |
| 19 | +from datetime import date, datetime |
20 | 20 | from enum import Enum |
21 | 21 | from types import UnionType |
22 | 22 | from typing import TYPE_CHECKING, Any, Generic, Self, TypeAlias, TypeVar |
|
42 | 42 | """Convenience alias for any filesystem-path-like object (``str`` or |
43 | 43 | ``os.PathLike``).""" |
44 | 44 |
|
45 | | -# TODO: accomodate other common data types such as datetime |
46 | | -TagValue: TypeAlias = int | str | None | Collection["TagValue"] |
47 | | -"""A tag metadata value: an int, string, ``None``, or an arbitrarily nested |
48 | | -collection thereof. Tags are used to label and organise data and |
49 | | -datagrams.""" |
| 45 | +TagValue: TypeAlias = int | str | date | datetime | None | Collection["TagValue"] |
| 46 | +"""A tag metadata value: an int, string, date, datetime, ``None``, or an |
| 47 | +arbitrarily nested collection thereof. Tags are used to label and organise |
| 48 | +data and datagrams.""" |
50 | 49 |
|
51 | 50 | PathSet: TypeAlias = PathLike | Collection[PathLike | None] |
52 | 51 | """A single path or an arbitrarily nested collection of paths (with optional |
53 | 52 | ``None`` entries). Used when operations need to address multiple files at |
54 | 53 | once, e.g. batch hashing.""" |
55 | 54 |
|
56 | | -SupportedNativePythonData: TypeAlias = str | int | float | bool | bytes |
| 55 | +SupportedNativePythonData: TypeAlias = str | int | float | bool | bytes | date | datetime |
57 | 56 | """The simple Python scalar types that have a direct Arrow / Polars |
58 | | -correspondence.""" |
| 57 | +correspondence, including temporal types (date and datetime).""" |
59 | 58 |
|
60 | 59 | ExtendedSupportedPythonData: TypeAlias = SupportedNativePythonData | PathSet |
61 | 60 | """Native scalar types extended with filesystem paths.""" |
|
0 commit comments