googleapis / python-bigquery-storage

Apache License 2.0
116 stars 46 forks source link

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

Closed flaky-bot[bot] closed 1 year ago

flaky-bot[bot] commented 1 year ago

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


commit: d58b0f7dad6513ff4195f6ae75b66a6176bba4a3 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}
        )

        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 = .any of 0      False\n1      False\n2      False\n3      False\n4      False\n       ...  \n533    False\n534    False\n535    False\n536    False\n537    False\nName: name, Length: 538, dtype: bool>()
E        +    where .any of 0      False\n1      False\n2      False\n3      False\n4      False\n       ...  \n533    False\n534    False\n535    False\n536    False\n537    False\nName: name, Length: 538, dtype: bool> = 0      False\n1      False\n2      False\n3      False\n4      False\n       ...  \n533    False\n534    False\n535    False\n536    False\n537    False\nName: name, Length: 538, dtype: bool.any
E        +      where 0      False\n1      False\n2      False\n3      False\n4      False\n       ...  \n533    False\n534    False\n535    False\n536    False\n537    False\nName: name, Length: 538, dtype: bool = >('Central Park')
E        +        where > = .startswith
E        +          where  = 0       St Johns Pl & Kingston Ave\n1      Patchen Ave & Bainbridge St\n2        W 170 St & University Ave\n3           Greenpoint Ave & 47 St\n4          Seneca Ave & Decatur St\n                  ...             \n533        Stanton St & Norfolk St\n534                5 Ave & E 63 St\n535                W 42 St & 6 Ave\n536          E 68 St & Madison Ave\n537                E 31 St & 3 Ave\nName: name, Length: 538, dtype: object.str

tests/system/reader/test_reader_dataframe.py:92: AssertionError
Linchin commented 1 year ago

see #695 for more info

flaky-bot[bot] commented 1 year ago

Looks like this issue is flaky. :worried:

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (d58b0f7dad6513ff4195f6ae75b66a6176bba4a3), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

Linchin commented 1 year ago

Closing because this issue only occurred once. If it happens recurringly, we will spend more time investigating it.