f78cfbb8255ab1d2d4f5e8762bf824bcaaad2208,tools/asset-inventory/tests/test_bigquery_schema.py,TestBigQuerySchema,test_bool,#TestBigQuerySchema#,73

Before Change


        schema = bigquery_schema.translate_json_to_schema(
            document)
        self.assertEqual(len(schema), 2)
        _, bool_array_field = bigquery_schema._get_field_by_name(
            schema,
            "bool_array_field")
        self.assertEqual(bool_array_field.name, "bool_array_field")
        self.assertEqual(bool_array_field.field_type, "BOOL")
        self.assertEqual(bool_array_field.mode, "REPEATED")
        _, bool_field = bigquery_schema._get_field_by_name(
            schema,
            "bool_field")
        self.assertEqual(bool_field.name, "bool_field")
        self.assertEqual(bool_field.field_type, "BOOL")
        self.assertEqual(bool_field.mode, "NULLABLE")

After Change


        document = {"bool_array_field": [True, False], "bool_field": False}
        schema = bigquery_schema.translate_json_to_schema(
            document)
        self.assertEqual(schema, [{"name": "bool_array_field",
                                   "field_type": "BOOL",
                                   "mode": "REPEATED"},
                                  {"name": "bool_field",
                                   "field_type": "BOOL",
                                   "mode": "NULLABLE"}
                                 ])

    def test_merge_schemas_basic(self):
        schemas = [
            bigquery_schema.translate_json_to_schema({
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: GoogleCloudPlatform/professional-services
Commit Name: f78cfbb8255ab1d2d4f5e8762bf824bcaaad2208
Time: 2019-03-18
Author: jferriero@google.com
File Name: tools/asset-inventory/tests/test_bigquery_schema.py
Class Name: TestBigQuerySchema
Method Name: test_bool


Project Name: GoogleCloudPlatform/professional-services
Commit Name: f78cfbb8255ab1d2d4f5e8762bf824bcaaad2208
Time: 2019-03-18
Author: jferriero@google.com
File Name: tools/asset-inventory/tests/test_bigquery_schema.py
Class Name: TestBigQuerySchema
Method Name: test_bool


Project Name: GoogleCloudPlatform/professional-services
Commit Name: f78cfbb8255ab1d2d4f5e8762bf824bcaaad2208
Time: 2019-03-18
Author: jferriero@google.com
File Name: tools/asset-inventory/tests/test_bigquery_schema.py
Class Name: TestBigQuerySchema
Method Name: test_numeric


Project Name: GoogleCloudPlatform/professional-services
Commit Name: f78cfbb8255ab1d2d4f5e8762bf824bcaaad2208
Time: 2019-03-18
Author: jferriero@google.com
File Name: tools/asset-inventory/tests/test_bigquery_schema.py
Class Name: TestBigQuerySchema
Method Name: test_merge_schemas_basic