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 — Core: Make build_api_url an instance method. by busunkim96 · Pull Request #8747 · googleapis/google-cloud-python

Conversation

@busunkim96

@busunkim96 busunkim96 commented Jul 24, 2019

Copy link
Copy Markdown
Contributor

See #8737.

Hmm, that @classmethod looks a little bogus to me. All actual uses of it are via instances:

$ git grep "\.build_api_url"
bigquery/tests/unit/test__http.py:        self.assertEqual(conn.build_api_url("/foo"), URI)
bigquery/tests/unit/test__http.py:        uri = conn.build_api_url("/foo", {"bar": "baz"})
bigquery/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
bigquery/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
core/google/cloud/_http.py:        url = self.build_api_url(
core/tests/unit/test__http.py:        self.assertEqual(conn.build_api_url("/foo"), URI)
core/tests/unit/test__http.py:        uri = conn.build_api_url("/foo", {"bar": "baz", "qux": ["quux", "corge"]})
dns/tests/unit/test__http.py:        self.assertEqual(conn.build_api_url("/foo"), URI)
dns/tests/unit/test__http.py:        uri = conn.build_api_url("/foo", {"bar": "baz"})
dns/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
logging/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
resource_manager/tests/unit/test__http.py:        self.assertEqual(conn.build_api_url("/foo"), URI)
resource_manager/tests/unit/test__http.py:        uri = conn.build_api_url("/foo", {"bar": "baz"})
resource_manager/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
runtimeconfig/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
storage/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")
storage/tests/unit/test__http.py:        self.assertEqual(conn.build_api_url("/foo"), URI)
storage/tests/unit/test__http.py:        uri = conn.build_api_url("/foo", {"bar": "baz"})
translate/tests/unit/test__http.py:        self.assertEqual(conn.build_api_url("/foo"), URI)
translate/tests/unit/test__http.py:        uri = conn.build_api_url("/foo", query_params=query_params)
translate/tests/unit/test__http.py:        expected_uri = conn.build_api_url("/rainbow")

Sorry, something went wrong.

Uh oh!

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

All reactions
@busunkim96 busunkim96 added the api: core label Jul 24, 2019
@busunkim96
busunkim96 requested a review from tseaver July 24, 2019 20:55
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 24, 2019
tseaver
tseaver approved these changes Jul 24, 2019
View reviewed changes
@tseaver

tseaver commented Jul 24, 2019

Copy link
Copy Markdown
Contributor

@busunkim96 This is a case where we'd actually like to test the change against the affected API libraries (bigquery, dns, logging, resource_manager, runtime_config, storage, translate), but our heuristic for determining whether to run them can't detect that. Can you verify that they still pass with this change?

All reactions

Sorry, something went wrong.

Uh oh!

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

@busunkim96
busunkim96 requested review from crwilcox, frankyn and tswast as code owners July 24, 2019 22:28
@busunkim96
busunkim96 requested a review from a team July 24, 2019 22:28
@busunkim96

busunkim96 commented Jul 25, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

BigQuery unit test failures seem to be unrelated:

=================================== FAILURES ===================================
___________________ test_bq_to_arrow_array_w_special_floats ____________________
module_under_test = <module 'google.cloud.bigquery._pandas_helpers' from '/tmpfs/src/github/google-cloud-python/bigquery/google/cloud/bigquery/_pandas_helpers.py'>
    @pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
    @pytest.mark.skipif(pyarrow is None, reason="Requires `pyarrow`")
    def test_bq_to_arrow_array_w_special_floats(module_under_test):
        bq_field = schema.SchemaField("field_name", "FLOAT64")
        rows = [float("-inf"), float("nan"), float("inf"), None]
        series = pandas.Series(rows, dtype="object")
        arrow_array = module_under_test.bq_to_arrow_array(series, bq_field)
        roundtrip = arrow_array.to_pylist()
        assert len(rows) == len(roundtrip)
        assert roundtrip[0] == float("-inf")
>       assert roundtrip[1] != roundtrip[1]  # NaN doesn't equal itself.
E       assert None != None
tests/unit/test__pandas_helpers.py:491: AssertionError
=============================== warnings summary =============```
All reactions

Sorry, something went wrong.

Uh oh!

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

@tseaver

tseaver commented Jul 25, 2019

Copy link
Copy Markdown
Contributor

The BigQuery failure is likely due to a new version of a dependency (pyarrow would be my guess).

The Logging failure is a known flakiness in systest teardown, #8676.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tseaver

tseaver commented Jul 26, 2019

Copy link
Copy Markdown
Contributor

@busunkim96 Do you want to back out d4f53bf from the PR before merging?

All reactions

Sorry, something went wrong.

Uh oh!

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

@tseaver

tseaver commented Jul 26, 2019

Copy link
Copy Markdown
Contributor

Also, a rebase would likely fix the BigQuery failure, if you'd like to do that first.

busunkim96 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.

@busunkim96
Change build_api_url to an instance method.
75a4b66
@busunkim96
busunkim96 force-pushed the cloud-core-update branch from d4f53bf to 75a4b66 Compare July 26, 2019 17:15
@busunkim96
busunkim96 merged commit f6d1f1d into googleapis:master Jul 26, 2019
@busunkim96
busunkim96 deleted the cloud-core-update branch July 26, 2019 17:34
parthea pushed a commit that referenced this pull request Nov 24, 2025
@busunkim96
Change build_api_url to an instance method. (#8747)
f899b62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@crwilcox crwilcox Awaiting requested review from crwilcox
@frankyn frankyn Awaiting requested review from frankyn
@tswast tswast Awaiting requested review from tswast
1 more reviewer
@tseaver tseaver tseaver 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: core 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.

3 participants

@busunkim96 @tseaver @googlebot
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.