8000 BigQuery: Remove references to `avro_schema` from `tests/unit/test_table.py`. · Issue #8855 · googleapis/google-cloud-python · GitHub
[go: up one dir, main page]

Skip to content

BigQuery: Remove references to avro_schema from tests/unit/test_table.py. #8855

@tswast

Description

@tswast

I noticed lines like the following in the unit tests for the table module:

session.avro_schema.schema = json.dumps(
            {
                "fields": [
                    {"name": "colA"},
                    # Not alphabetical to test column order.
                    {"name": "colC"},
                    {"name": "colB"},
                ]
            }
        )

Now that we're creating Arrow sessions, we should update these unit tests to populate the Arrow schema, instead. There are examples of doing this in the tests for google-cloud-bigquery-storage.

def _generate_arrow_read_session(arrow_schema):
return bigquery_storage_v1beta1.types.ReadSession(
arrow_schema={"serialized_schema": arrow_schema.serialize().to_pybytes()}
)

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0