Skip to content

Commit 7dfe8f5

Browse files
committed
drop usage of pytz in tests; add pytz to constraints as a dependency of pandas
1 parent 13f6df0 commit 7dfe8f5

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.librarian/generator-input/client-post-processing/bigquery-storage-integration.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ replacements:
461461
google-api-core==1.34.1
462462
libcst==0.2.5
463463
fastavro==0.21.2
464+
# pytz is required by pandas
465+
pytz
464466
pandas==1.0.5
465467
pyarrow==0.15.0
466468
google-auth==2.14.1

packages/google-cloud-bigquery-storage/tests/system/reader/test_reader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import uuid
2323

2424
import pytest
25-
import pytz
2625

2726
from google.cloud import bigquery
2827

@@ -451,7 +450,7 @@ def test_decoding_data_types(
451450
"bool_field": True,
452451
"geography_field": "POINT(-49.3028 69.0622)",
453452
"person_struct_field": {"name": "John", "age": 42},
454-
"timestamp_field": dt.datetime(2019, 8, 9, 13, 38, 22, 17896, tzinfo=pytz.UTC),
453+
"timestamp_field": dt.datetime(2019, 8, 9, 13, 38, 22, 17896, tzinfo=dt.timezone.utc),
455454
"date_field": dt.date(1995, 3, 17),
456455
"time_field": dt.time(16, 24, 51),
457456
"string_array_field": ["foo", "bar", "baz"],

packages/google-cloud-bigquery-storage/tests/unit/helpers.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import datetime
1818
import decimal
1919

20-
import pytz
21-
2220
SCALAR_COLUMNS = [
2321
{"name": "int_col", "type": "int64"},
2422
{"name": "float_col", "type": "float64"},
@@ -42,7 +40,7 @@
4240
"bytes_col": b"ascii bytes",
4341
"date_col": datetime.date(1998, 9, 4),
4442
"time_col": datetime.time(12, 0),
45-
"ts_col": datetime.datetime(2000, 1, 1, 5, 0, tzinfo=pytz.utc),
43+
"ts_col": datetime.datetime(2000, 1, 1, 5, 0, tzinfo=datetime.timezone.utc),
4644
},
4745
{
4846
"int_col": 456,
@@ -53,7 +51,7 @@
5351
"bytes_col": b"\xbb\xee\xff",
5452
"date_col": datetime.date(1995, 3, 2),
5553
"time_col": datetime.time(13, 37),
56-
"ts_col": datetime.datetime(1965, 4, 3, 2, 1, tzinfo=pytz.utc),
54+
"ts_col": datetime.datetime(1965, 4, 3, 2, 1, tzinfo=datetime.timezone.utc),
5755
},
5856
],
5957
[
@@ -66,7 +64,7 @@
6664
"bytes_col": b"\x54\x69\x6d",
6765
"date_col": datetime.date(1970, 1, 1),
6866
"time_col": datetime.time(16, 20),
69-
"ts_col": datetime.datetime(1991, 8, 25, 20, 57, 8, tzinfo=pytz.utc),
67+
"ts_col": datetime.datetime(1991, 8, 25, 20, 57, 8, tzinfo=datetime.timezone.utc),
7068
}
7169
],
7270
]

0 commit comments

Comments
 (0)