Skip to content

Commit

Permalink
got index & schema test code completed!
Browse files Browse the repository at this point in the history
  • Loading branch information
tnixon committed Jan 16, 2024
1 parent 2127f3b commit 4d4a8f3
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 174 deletions.
18 changes: 9 additions & 9 deletions python/tempo/tsschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,13 +874,13 @@ def fromDFSchema(cls,
return cls(ts_idx, series_ids)

@classmethod
def fromParsedTSIndex(cls,
df_schema: StructType,
ts_col: str,
parsed_field: str,
src_str_field: str,
series_ids: Optional[Collection[str]] = None,
secondary_parsed_field: Optional[str] = None) -> "TSSchema":
def fromParsedTimestamp(cls,
df_schema: StructType,
ts_col: str,
parsed_field: str,
src_str_field: str,
series_ids: Optional[Collection[str]] = None,
secondary_parsed_field: Optional[str] = None) -> "TSSchema":
ts_idx_schema = df_schema[ts_col].dataType
assert isinstance(ts_idx_schema, StructType), \
f"Expected a StructType for ts_col {ts_col}, but got {ts_idx_schema}"
Expand All @@ -907,8 +907,8 @@ def fromParsedTSIndex(cls,
)
else:
raise TypeError(
f"Expected a DoubleType, TimestampType or DateType for parsed_field {parsed_field}, "
f"but got {parsed_type}"
f"Expected a DoubleType, TimestampType or DateType "
f"for parsed_field {parsed_field}, but got {parsed_type}"
)
# construct the TSSchema
return cls(ts_idx, series_ids)
Expand Down
Loading

0 comments on commit 4d4a8f3

Please sign in to comment.