diff --git a/storey/dtypes.py b/storey/dtypes.py index d9a98d49..dbe1abb7 100644 --- a/storey/dtypes.py +++ b/storey/dtypes.py @@ -14,7 +14,7 @@ from datetime import datetime, timezone from enum import Enum -from typing import Callable, List, Literal, NamedTuple, Optional, Union +from typing import Callable, List, Optional, Union import numpy @@ -456,12 +456,16 @@ class FixedWindowType(Enum): LastClosedWindow = 2 -class _TDEngineField(NamedTuple): - field: str - # https://docs.tdengine.com/reference/taos-sql/data-type/ - type: Literal["TIMESTAMP", "INT", "FLOAT", "DOUBLE", "BINARY", "BOOL", "NCHAR", "JSON", "VARCHAR"] - length: int - note: Literal["", "TAG"] - encode: str - compress: str - level: str +class _TDEngineField: + def __init__( + self, + field: str, + field_type: str, + length: int, + note: str, + *args, + ): + self.field = field + self.field_type = field_type + self.length = length + self.note = note diff --git a/storey/targets.py b/storey/targets.py index d5f5377b..75b3c367 100644 --- a/storey/targets.py +++ b/storey/targets.py @@ -948,7 +948,7 @@ def _get_table_schema( reg_cols_schema = [] for field in fields: field_name = field.field - field_type = field.type + field_type = field.field_type if field.note == "TAG": if field_type in self._tdengine_type_to_tag_func: