We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 374608b commit 45ea992Copy full SHA for 45ea992
1 file changed
bigquery/tests/system.py
@@ -2369,7 +2369,12 @@ def test_nested_table_to_dataframe(self):
2369
row = df.iloc[0]
2370
# verify the row content
2371
self.assertEqual(row["string_col"], "Some value")
2372
- self.assertEqual(row["record_col"], record)
+ expected_keys = tuple(sorted(record.keys()))
2373
+ row_keys = tuple(sorted(row["record_col"].keys()))
2374
+ self.assertEqual(row_keys, expected_keys)
2375
+ # Can't compare numpy arrays, which pyarrow encodes the embedded
2376
+ # repeated column to, so convert to list.
2377
+ self.assertEqual(list(row["record_col"]["nested_repeated"]), [0, 1, 2])
2378
# verify that nested data can be accessed with indices/keys
2379
self.assertEqual(row["record_col"]["nested_repeated"][0], 0)
2380
self.assertEqual(
0 commit comments