Skip to content

tests.system.test_to_gbq: test_dataframe_round_trip_with_table_schema[load_csv-issue365-extreme-datetimes] failed #626

Closed
googleapis/python-db-dtypes-pandas
#180
@flaky-bot

Description

@flaky-bot

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: 1dca732
buildURL: Build Status, Sponge
status: failed

Test output
method_under_test = functools.partial(, project_id='precise-truck-742', credentials=)
read_gbq = functools.partial(, project_id='precise-truck-742', credentials=)
random_dataset_id = 'python_bigquery_pandas_tests_system_20230330105227_59ed3e'
input_df =    row_num  ...                     timestamp_col
0        1  ...         0001-01-01 00:00:00+00:00
1        2  ...         1970-01-01 00:00:00+00:00
2        3  ...  9999-12-31 23:59:59.999999+00:00

[3 rows x 4 columns]
expected_df = row_num ... timestamp_col
0 1 ... 0001-01-01 00:00:00+00:00
1 2 ... 1970-01-01 00:00:00+00:00
2 3 ... 9999-12-31 23:59:59.999999+00:00

[3 rows x 4 columns]
table_schema = [{'name': 'row_num', 'type': 'INTEGER'}, {'name': 'date_col', 'type': 'DATE'}, {'name': 'datetime_col', 'type': 'DATETIME'}, {'name': 'timestamp_col', 'type': 'TIMESTAMP'}]
api_method = 'load_csv', api_methods = {'load_csv', 'load_parquet'}

@pytest.mark.parametrize(
    ["input_df", "expected_df", "table_schema", "api_methods"], DATAFRAME_ROUND_TRIPS
)
def test_dataframe_round_trip_with_table_schema(
    method_under_test,
    read_gbq,
    random_dataset_id,
    input_df,
    expected_df,
    table_schema,
    api_method,
    api_methods,
):
    if api_method not in api_methods:
        pytest.skip(f"{api_method} not supported.")
    if expected_df is None:
        expected_df = input_df
    table_id = f"{random_dataset_id}.round_trip_w_schema_{random.randrange(1_000_000)}"
    method_under_test(
        input_df, table_id, table_schema=table_schema, api_method=api_method
    )
    round_trip = read_gbq(
        table_id,
        dtypes=dict(zip(expected_df.columns, expected_df.dtypes)),
        # BigQuery Storage API is required to avoid out-of-bound due to extra
        # day from rounding error which was fixed in google-cloud-bigquery
        # 2.6.0. https://github.com/googleapis/python-bigquery/pull/402
        use_bqstorage_api=True,
    )
    round_trip.sort_values("row_num", inplace=True)
  pandas.testing.assert_frame_equal(expected_df, round_trip)

E AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="date_col") are different
E
E Attribute "dtype" are different
E [left]: object
E [right]: dbdate

tests/system/test_to_gbq.py:277: AssertionError

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/python-bigquery-pandas API.flakybot: flakyTells the Flaky Bot not to close or comment on this issue.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