Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-13016] Remove avro-python3 dependency from Beam #15900

Merged
merged 12 commits into from
Nov 11, 2021
Prev Previous commit
Next Next commit
Modified test case for bigquery_avro_tools_test.py
  • Loading branch information
AnandInguva committed Nov 10, 2021
commit 054594daab689eb29ee2814cab5637ac7321c585
27 changes: 27 additions & 0 deletions sdks/python/apache_beam/io/gcp/bigquery_avro_tools_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,33 @@ def test_convert_bigquery_schema_to_avro_schema(self):

parsed_schema = parse_schema(avro_schema)
self.assertEqual(type(parsed_schema), dict)
AnandInguva marked this conversation as resolved.
Show resolved Hide resolved
# names: key -> name, value -> different types allowed
names = {
"number": 4,
"species": 2,
"quality": 2,
"grade": 2,
"quantity": 2,
"dependents": 2,
"birthday": 2,
"birthdayMoney": 2,
"flighted": 2,
"flighted2": 2,
"sound": 2,
"anniversaryDate": 2,
"anniversaryDatetime": 2,
"anniversaryTime": 2,
"scion": 2,
"family": 2,
"associates": 2,
"geoPositions": 2,
}
# simple test case to check if the schema is parsed right.
fields = parsed_schema["fields"]
for i in range(len(fields)):
field_ = fields[i]
assert 'name' in field_ and field_['name'] in names
self.assertEqual(len(field_['type']), names[field_['name']])


if __name__ == '__main__':
Expand Down