Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

tests.system.reader.test_reader_dataframe: test_read_rows_to_dataframe[v1-AVRO-avro_schema] failed #318

@flaky-bot

Description

@flaky-bot

Note: #258 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: f5b5d77
buildURL: Build Status, Sponge
status: failed

Test output
client_and_types = (, )
project_id = 'precise-truck-742', data_format = 'AVRO'
expected_schema_type = 'avro_schema'
@pytest.mark.parametrize(
    "data_format,expected_schema_type",
    (("AVRO", "avro_schema"), ("ARROW", "arrow_schema")),
)
def test_read_rows_to_dataframe(
    client_and_types, project_id, data_format, expected_schema_type
):
    client, types = client_and_types
    read_session = types.ReadSession()
    read_session.table = "projects/{}/datasets/{}/tables/{}".format(
        "bigquery-public-data", "new_york_citibike", "citibike_stations"
    )
    read_session.data_format = data_format

    session = client.create_read_session(
        request={
            "parent": "projects/{}".format(project_id),
            "read_session": read_session,
            "max_stream_count": 1,
        }
    )
    schema_type = session._pb.WhichOneof("schema")
    assert schema_type == expected_schema_type

    stream = session.streams[0].name

    frame = client.read_rows(stream).to_dataframe(
        session, dtypes={"latitude": numpy.float16}
    )

    # Station ID is a required field (no nulls), so the datatype should always
    # be integer.
    assert frame.station_id.dtype.name == "int64"
    assert frame.latitude.dtype.name == "float16"
    assert frame.longitude.dtype.name == "float64"
  assert frame["name"].str.startswith("Central Park").any()

E AssertionError: assert False
E + where False = <bound method NDFrame._add_numeric_operations..any of 0 False\n1 False\n2 False\n3 False\n4 ...lse\n ... \n549 False\n550 False\n551 False\n552 False\n553 False\nName: name, Length: 554, dtype: bool>()
E + where <bound method NDFrame._add_numeric_operations..any of 0 False\n1 False\n2 False\n3 False\n4 ...lse\n ... \n549 False\n550 False\n551 False\n552 False\n553 False\nName: name, Length: 554, dtype: bool> = 0 False\n1 False\n2 False\n3 False\n4 False\n ... \n549 False\n550 False\n551 False\n552 False\n553 False\nName: name, Length: 554, dtype: bool.any
E + where 0 False\n1 False\n2 False\n3 False\n4 False\n ... \n549 False\n550 False\n551 False\n552 False\n553 False\nName: name, Length: 554, dtype: bool = <bound method StringMethods.startswith of <pandas.core.strings.accessor.StringMethods object at 0x7f3e48f51670>>('Central Park')
E + where <bound method StringMethods.startswith of <pandas.core.strings.accessor.StringMethods object at 0x7f3e48f51670>> = <pandas.core.strings.accessor.StringMethods object at 0x7f3e48f51670>.startswith
E + where <pandas.core.strings.accessor.StringMethods object at 0x7f3e48f51670> = 0 Driggs Ave & N 9 St\n1 W 42 St & Dyer Ave\n2 University Pl & E 14 St\n3 ...Worth St\n552 W 15 St & 7 Ave\n553 E 16 St & Irving Pl\nName: name, Length: 554, dtype: object.str

tests/system/reader/test_reader_dataframe.py:95: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigquerystorageIssues related to the googleapis/python-bigquery-storage API.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions