Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdks/python/apache_beam/io/gcp/bigquery_json_it_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ def process(self, row):
# Test country (JSON String)
country_actual = json.loads(row["country"])
country_expected = json.loads(expected["country"])
self.assertTrue(country_expected == country_actual)
self.assertEqual(country_expected, country_actual)

# Test stats (JSON String in BigQuery struct)
for stat, value in row["stats"].items():
stats_actual = json.loads(value)
stats_expected = json.loads(expected["stats"][stat])
self.assertTrue(stats_expected == stats_actual)
self.assertEqual(stats_expected, stats_actual)

# Test cities (JSON String in BigQuery array of structs)
for city_row in row["cities"]:
Expand All @@ -115,15 +115,15 @@ def process(self, row):

city_actual = json.loads(city)
city_expected = json.loads(expected["cities"][city_name])
self.assertTrue(city_expected == city_actual)
self.assertEqual(city_expected, city_actual)

# Test landmarks (JSON String in BigQuery array)
landmarks_actual = row["landmarks"]
landmarks_expected = expected["landmarks"]
for i in range(len(landmarks_actual)):
l_actual = json.loads(landmarks_actual[i])
l_expected = json.loads(landmarks_expected[i])
self.assertTrue(l_expected == l_actual)
self.assertEqual(l_expected, l_actual)

parser = argparse.ArgumentParser()
parser.add_argument('--read_method')
Expand Down