Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
flaky-bot bot opened this issue Mar 30, 2023 · 2 comments · Fixed by googleapis/python-db-dtypes-pandas#180
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@flaky-bot
Copy link

flaky-bot bot commented Mar 30, 2023

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

@flaky-bot flaky-bot bot added flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 30, 2023
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-pandas API. label Mar 30, 2023
@flaky-bot flaky-bot bot added the flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. label Mar 30, 2023
@flaky-bot
Copy link
Author

flaky-bot bot commented Mar 30, 2023

Looks like this issue is flaky. 😟

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

A human should fix and close this.


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

@flaky-bot
Copy link
Author

flaky-bot bot commented Mar 30, 2023

Oops! Looks like this issue is still flaky. It failed again. 😬

I reopened the issue, but a human will need to close it again.


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_20230330183656_b4fbe0'
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant