Skip to content

Commit 9d308b8

Browse files
committed
cast proto enums
1 parent d530384 commit 9d308b8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

python/lib/sift_client/_tests/resources/test_data_imports.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from datetime import datetime, timezone
6+
from typing import TYPE_CHECKING, cast
67

78
import pytest
89
from sift.common.type.v1.channel_config_pb2 import ChannelConfig as ChannelConfigProto
@@ -41,6 +42,11 @@
4142
TimeFormat,
4243
)
4344

45+
if TYPE_CHECKING:
46+
from sift.common.type.v1.channel_data_type_pb2 import (
47+
ChannelDataType as ChannelDataTypeProto,
48+
)
49+
4450

4551
@pytest.mark.integration
4652
def test_client_binding(sift_client):
@@ -421,7 +427,10 @@ def _make_flat_dataset_response(
421427
data_columns=[
422428
ParquetDataColumnProto(
423429
path=path,
424-
channel_config=ChannelConfigProto(name=path, data_type=data_type),
430+
channel_config=ChannelConfigProto(
431+
name=path,
432+
data_type=cast("ChannelDataTypeProto.ValueType", data_type),
433+
),
425434
)
426435
for path, data_type in data_columns
427436
],
@@ -436,7 +445,10 @@ def _make_scpr_response(time_path: str, columns: list[tuple[str, int]]) -> Parqu
436445
columns=[
437446
ParquetColumn(
438447
path=path,
439-
column_config=ChannelConfigProto(name=path, data_type=data_type),
448+
column_config=ChannelConfigProto(
449+
name=path,
450+
data_type=cast("ChannelDataTypeProto.ValueType", data_type),
451+
),
440452
)
441453
for path, data_type in columns
442454
],

0 commit comments

Comments
 (0)