Skip to content

Commit 328d048

Browse files
committed
make code compatible with py 3.9
1 parent 0d33415 commit 328d048

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

bigframes/core/logging/data_types.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,34 @@ def _add_data_type(existing_types: int, curr_type: dtypes.Dtype) -> int:
2121

2222

2323
def _get_dtype_mask(dtype: dtypes.Dtype) -> int:
24-
match dtype:
25-
case dtypes.INT_DTYPE:
26-
return 1 << 1
27-
case dtypes.FLOAT_DTYPE:
28-
return 1 << 2
29-
case dtypes.BOOL_DTYPE:
30-
return 1 << 3
31-
case dtypes.STRING_DTYPE:
32-
return 1 << 4
33-
case dtypes.BYTES_DTYPE:
34-
return 1 << 5
35-
case dtypes.DATE_DTYPE:
36-
return 1 << 6
37-
case dtypes.TIME_DTYPE:
38-
return 1 << 7
39-
case dtypes.DATETIME_DTYPE:
40-
return 1 << 8
41-
case dtypes.TIMESTAMP_DTYPE:
42-
return 1 << 9
43-
case dtypes.TIMEDELTA_DTYPE:
44-
return 1 << 10
45-
case dtypes.NUMERIC_DTYPE:
46-
return 1 << 11
47-
case dtypes.BIGNUMERIC_DTYPE:
48-
return 1 << 12
49-
case dtypes.GEO_DTYPE:
50-
return 1 << 13
51-
case dtypes.JSON_DTYPE:
52-
return 1 << 14
24+
if dtype == dtypes.INT_DTYPE:
25+
return 1 << 1
26+
if dtype == dtypes.FLOAT_DTYPE:
27+
return 1 << 2
28+
if dtype == dtypes.BOOL_DTYPE:
29+
return 1 << 3
30+
if dtype == dtypes.STRING_DTYPE:
31+
return 1 << 4
32+
if dtype == dtypes.BYTES_DTYPE:
33+
return 1 << 5
34+
if dtype == dtypes.DATE_DTYPE:
35+
return 1 << 6
36+
if dtype == dtypes.TIME_DTYPE:
37+
return 1 << 7
38+
if dtype == dtypes.DATETIME_DTYPE:
39+
return 1 << 8
40+
if dtype == dtypes.TIMESTAMP_DTYPE:
41+
return 1 << 9
42+
if dtype == dtypes.TIMEDELTA_DTYPE:
43+
return 1 << 10
44+
if dtype == dtypes.NUMERIC_DTYPE:
45+
return 1 << 11
46+
if dtype == dtypes.BIGNUMERIC_DTYPE:
47+
return 1 << 12
48+
if dtype == dtypes.GEO_DTYPE:
49+
return 1 << 13
50+
if dtype == dtypes.JSON_DTYPE:
51+
return 1 << 14
5352

5453
if dtypes.is_struct_like(dtype):
5554
mask = 1 << 15

0 commit comments

Comments
 (0)