GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: expand pyarrow dependencies to include version 2 by tswast · Pull Request #368 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@tswast

@tswast tswast commented Nov 4, 2020

Copy link
Copy Markdown
Contributor

Pyarrow 2.0 includes several bug fixes. The wire format remains the same, so it continues to be compatible with the BigQuery Storage API.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast
deps: expand pyarrow dependencies to include version 2
6d6a21f
@tswast
tswast requested review from a team and stephaniewang526 November 4, 2020 22:23
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 4, 2020
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Nov 4, 2020
@tswast tswast mentioned this pull request Nov 4, 2020
feat: added system test and sample for dataframe contains array #365
Closed
@tswast

tswast commented Nov 4, 2020

Copy link
Copy Markdown
Contributor Author

Test failure is relevant

______ TestRowIterator.test_to_dataframe_timestamp_out_of_pyarrow_bounds _______

self = <tests.unit.test_table.TestRowIterator testMethod=test_to_dataframe_timestamp_out_of_pyarrow_bounds>

    @pytest.mark.xfail(
        six.PY2,
        reason=(
            "Requires pyarrow>-1.0 to work, but the latter is not compatible "
            "with Python 2 anymore."
        ),
    )
    @unittest.skipIf(pandas is None, "Requires `pandas`")
    @unittest.skipIf(pyarrow is None, "Requires `pyarrow`")
    def test_to_dataframe_timestamp_out_of_pyarrow_bounds(self):
        from google.cloud.bigquery.schema import SchemaField
    
        schema = [SchemaField("some_timestamp", "TIMESTAMP")]
        rows = [
            {"f": [{"v": "81953424000.0"}]},  # 4567-01-01 00:00:00  UTC
            {"f": [{"v": "253402214400.0"}]},  # 9999-12-31 00:00:00  UTC
        ]
        path = "/foo"
        api_request = mock.Mock(return_value={"rows": rows})
        row_iterator = self._make_one(_mock_client(), api_request, path, schema)
    
        df = row_iterator.to_dataframe(create_bqstorage_client=False)
    
        self.assertIsInstance(df, pandas.DataFrame)
        self.assertEqual(len(df), 2)  # verify the number of rows
        self.assertEqual(list(df.columns), ["some_timestamp"])
>       self.assertEqual(
            list(df["some_timestamp"]),
            [dt.datetime(4567, 1, 1), dt.datetime(9999, 12, 31)],
        )
E       AssertionError: Lists differ: [date[25 chars] 0, 0, tzinfo=<UTC>), datetime.datetime(9999, [23 chars]TC>)] != [date[25 chars] 0, 0), datetime.datetime(9999, 12, 31, 0, 0)]
E       
E       First differing element 0:
E       datetime.datetime(4567, 1, 1, 0, 0, tzinfo=<UTC>)
E       datetime.datetime(4567, 1, 1, 0, 0)
E       
E       + [datetime.datetime(4567, 1, 1, 0, 0), datetime.datetime(9999, 12, 31, 0, 0)]
E       - [datetime.datetime(4567, 1, 1, 0, 0, tzinfo=<UTC>),
E       -  datetime.datetime(9999, 12, 31, 0, 0, tzinfo=<UTC>)]

tests/unit/test_table.py:2345: AssertionError
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
test: fix timestamp test for pyarrow 2.0
8d9b0ba
@tswast

tswast commented Nov 5, 2020

Copy link
Copy Markdown
Contributor Author

Fixed the test failure in the latest commit. Even though the behavior is slightly different between pyarrow 1.0 and 2.0 as seen in the commit, I think it's worth keeping a wider range due to Arrow's use as a core library.

stephaniewang526 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stephaniewang526
stephaniewang526 approved these changes Nov 10, 2020
View reviewed changes
@tswast
Merge branch 'master' into pyarrow2.0
3699f3c
@tswast tswast added the automerge Merge the pull request once unit tests and other checks pass. label Nov 10, 2020
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit cd9febd into googleapis:master Nov 10, 2020
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@stephaniewang526 stephaniewang526 stephaniewang526 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tswast @stephaniewang526
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.