Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 936e0a5

Browse files
test: test on Python 3.9 (#99)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * docs(python): update intersphinx for grpc and auth * docs(python): update intersphinx for grpc and auth * use https for python intersphinx Co-authored-by: Tim Swast <swast@google.com> Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Nov 18 14:37:25 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 9a7d9fbb7045c34c9d3d22c1ff766eeae51f04c9 Source-Link: googleapis/synthtool@9a7d9fb * remove unnecessary index.html * add temporary hack to remove pyarrow from 3.9 builds * typo * test: separate pyarrow tests from other tests * test: lint errors * test: add missing fixtures Co-authored-by: Tim Swast <swast@google.com>
1 parent 4842e99 commit 936e0a5

7 files changed

Lines changed: 440 additions & 359 deletions

File tree

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@
345345

346346
# Example configuration for intersphinx: refer to the Python standard library.
347347
intersphinx_mapping = {
348-
"python": ("http://python.readthedocs.org/en/latest/", None),
349-
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
348+
"python": ("https://python.readthedocs.org/en/latest/", None),
349+
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
350350
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
351-
"grpc": ("https://grpc.io/grpc/python/", None),
351+
"grpc": ("https://grpc.github.io/grpc/python/", None),
352352
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
353353
}
354354

noxfile.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
DEFAULT_PYTHON_VERSION = "3.8"
3030
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
31-
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8"]
31+
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
3232

3333

3434
@nox.session(python=DEFAULT_PYTHON_VERSION)
@@ -75,7 +75,10 @@ def default(session):
7575
session.install(
7676
"mock", "pytest", "pytest-cov",
7777
)
78-
session.install("-e", ".[fastavro,pandas,pyarrow]")
78+
extras = "fastavro,pandas,pyarrow"
79+
if session.python == "3.9":
80+
extras = "fastavro,pandas"
81+
session.install("-e", f".[{extras}]")
7982

8083
# Run py.test against the unit tests.
8184
session.run(
@@ -129,7 +132,10 @@ def system(session):
129132
session.install(
130133
"mock", "pytest", "google-cloud-testutils",
131134
)
132-
session.install("-e", ".[fastavro,pandas,pyarrow]")
135+
extras = "fastavro,pandas,pyarrow"
136+
if session.python == "3.9":
137+
extras = "fastavro,pandas"
138+
session.install("-e", f".[{extras}]")
133139

134140
# Run py.test against the system tests.
135141
if system_test_exists:

synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-bigquery-storage.git",
7-
"sha": "7cf4f32abde1436fbe6c0848647b4ff703e60f85"
7+
"sha": "994a7c1cb1f8008e630d2325a9c168001e5081b4"
88
}
99
},
1010
{
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
22+
"sha": "9a7d9fbb7045c34c9d3d22c1ff766eeae51f04c9"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b"
29+
"sha": "9a7d9fbb7045c34c9d3d22c1ff766eeae51f04c9"
3030
}
3131
}
3232
],

tests/unit/__init__.py

Whitespace-only changes.

tests/unit/helpers.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2018 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the 'License');
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an 'AS IS' BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
import datetime
18+
import decimal
19+
20+
import pytz
21+
22+
23+
SCALAR_COLUMNS = [
24+
{"name": "int_col", "type": "int64"},
25+
{"name": "float_col", "type": "float64"},
26+
{"name": "num_col", "type": "numeric"},
27+
{"name": "bool_col", "type": "bool"},
28+
{"name": "str_col", "type": "string"},
29+
{"name": "bytes_col", "type": "bytes"},
30+
{"name": "date_col", "type": "date"},
31+
{"name": "time_col", "type": "time"},
32+
{"name": "ts_col", "type": "timestamp"},
33+
]
34+
SCALAR_COLUMN_NAMES = [field["name"] for field in SCALAR_COLUMNS]
35+
SCALAR_BLOCKS = [
36+
[
37+
{
38+
"int_col": 123,
39+
"float_col": 3.14,
40+
"num_col": decimal.Decimal("9.99"),
41+
"bool_col": True,
42+
"str_col": "hello world",
43+
"bytes_col": b"ascii bytes",
44+
"date_col": datetime.date(1998, 9, 4),
45+
"time_col": datetime.time(12, 0),
46+
"ts_col": datetime.datetime(2000, 1, 1, 5, 0, tzinfo=pytz.utc),
47+
},
48+
{
49+
"int_col": 456,
50+
"float_col": 2.72,
51+
"num_col": decimal.Decimal("0.99"),
52+
"bool_col": False,
53+
"str_col": "hallo welt",
54+
"bytes_col": b"\xbb\xee\xff",
55+
"date_col": datetime.date(1995, 3, 2),
56+
"time_col": datetime.time(13, 37),
57+
"ts_col": datetime.datetime(1965, 4, 3, 2, 1, tzinfo=pytz.utc),
58+
},
59+
],
60+
[
61+
{
62+
"int_col": 789,
63+
"float_col": 1.23,
64+
"num_col": decimal.Decimal("5.67"),
65+
"bool_col": True,
66+
"str_col": u"こんにちは世界",
67+
"bytes_col": b"\x54\x69\x6d",
68+
"date_col": datetime.date(1970, 1, 1),
69+
"time_col": datetime.time(16, 20),
70+
"ts_col": datetime.datetime(1991, 8, 25, 20, 57, 8, tzinfo=pytz.utc),
71+
}
72+
],
73+
]

0 commit comments

Comments
 (0)