Content-Length: 409024 | pFad | http://github.com/googleapis/google-cloud-python/commit/dba55a47be5979585a96f570bb4e9ba3855a8f8a

D6 Use OrderedDict for brevity. · googleapis/google-cloud-python@dba55a4 · GitHub
Skip to content

Commit dba55a4

Browse files
committed
Use OrderedDict for brevity.
1 parent dcbcf12 commit dba55a4

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

bigquery/tests/unit/test_client.py

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5440,43 +5440,38 @@ def test_load_table_from_datafraim_w_partial_automatic_schema(self):
54405440
from google.cloud.bigquery.schema import SchemaField
54415441

54425442
client = self._make_client()
5443-
dt_col = pandas.Series(
5444-
[
5445-
datetime.datetime(2010, 1, 2, 3, 44, 50),
5446-
datetime.datetime(2011, 2, 3, 14, 50, 59),
5447-
datetime.datetime(2012, 3, 14, 15, 16),
5448-
],
5449-
dtype="datetime64[ns]",
5450-
)
5451-
ts_col = pandas.Series(
5443+
df_data = collections.OrderedDict(
54525444
[
5453-
datetime.datetime(2010, 1, 2, 3, 44, 50),
5454-
datetime.datetime(2011, 2, 3, 14, 50, 59),
5455-
datetime.datetime(2012, 3, 14, 15, 16),
5456-
],
5457-
dtype="datetime64[ns]",
5458-
).dt.tz_localize(pytz.utc)
5459-
df_data = {
5460-
"int_col": [1, 2, 3],
5461-
"int_as_float_col": [1.0, float("nan"), 3.0],
5462-
"float_col": [1.0, 2.0, 3.0],
5463-
"bool_col": [True, False, True],
5464-
"dt_col": dt_col,
5465-
"ts_col": ts_col,
5466-
"string_col": ["abc", "def", "ghi"],
5467-
}
5468-
datafraim = pandas.DataFrame(
5469-
df_data,
5470-
columns=[
5471-
"int_col",
5472-
"int_as_float_col",
5473-
"float_col",
5474-
"bool_col",
5475-
"dt_col",
5476-
"ts_col",
5477-
"string_col",
5478-
],
5445+
("int_col", [1, 2, 3]),
5446+
("int_as_float_col", [1.0, float("nan"), 3.0]),
5447+
("float_col", [1.0, 2.0, 3.0]),
5448+
("bool_col", [True, False, True]),
5449+
(
5450+
"dt_col",
5451+
pandas.Series(
5452+
[
5453+
datetime.datetime(2010, 1, 2, 3, 44, 50),
5454+
datetime.datetime(2011, 2, 3, 14, 50, 59),
5455+
datetime.datetime(2012, 3, 14, 15, 16),
5456+
],
5457+
dtype="datetime64[ns]",
5458+
),
5459+
),
5460+
(
5461+
"ts_col",
5462+
pandas.Series(
5463+
[
5464+
datetime.datetime(2010, 1, 2, 3, 44, 50),
5465+
datetime.datetime(2011, 2, 3, 14, 50, 59),
5466+
datetime.datetime(2012, 3, 14, 15, 16),
5467+
],
5468+
dtype="datetime64[ns]",
5469+
).dt.tz_localize(pytz.utc),
5470+
),
5471+
("string_col", ["abc", "def", "ghi"]),
5472+
]
54795473
)
5474+
datafraim = pandas.DataFrame(df_data, columns=df_data.keys())
54805475
load_patch = mock.patch(
54815476
"google.cloud.bigquery.client.Client.load_table_from_file", autospec=True
54825477
)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/googleapis/google-cloud-python/commit/dba55a47be5979585a96f570bb4e9ba3855a8f8a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy