Skip to content

chore: show FutureWarning for LEP endpoints usage with use_regional_endpoints=True #1432

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

Merged
merged 6 commits into from
Feb 27, 2025

Conversation

shobsi
Copy link
Contributor

@shobsi shobsi commented Feb 27, 2025

>>> import bigframes.pandas as bpd
>>> bpd.options.bigquery.use_regional_endpoints = True
<stdin>:1: PreviewWarning: Use of regional endpoints is a feature in preview and available only in selected regions and projects.
>>> bpd.options.bigquery.location = "europe-west1"
>>> s = bpd.get_global_session()
.../bigframes/bigframes/session/clients.py:106: FutureWarning: Support for regional endpoints is not yet available in the location
europe-west1 for BigQuery and BigQuery Storage APIs. For the supported
locations and APIs see https://cloud.google.com/bigquery/docs/regional-endpoints.
For other locations and APIs, currently an older, now deprecated locational
endpoints are being used, which requires your project to be allowlisted. In
future version 2.0 onwards the locational endpoints will no longer be
supported automatically when you enable regional endpoints. However, if you
still need them, you will be able to override the endpoints directly by
doing the following:
    bigframes.pandas.options.bigquery.client_endpoints_override = {
        "bqclient": "https://europe-west1-bigquery.googleapis.com",
        "bqconnectionclient": "europe-west1-bigqueryconnection.googleapis.com",
        "bqstoragereadclient": "europe-west1-bigquerystorage.googleapis.com"
    }
  warnings.warn(
Query job ... is DONE.0 Bytes processed.
https://console.cloud.google.com/bigquery?project=...
>>> 

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes internal issue 399101005 🦕

@shobsi shobsi requested a review from tswast February 27, 2025 01:25
@shobsi shobsi requested review from a team as code owners February 27, 2025 01:25
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Feb 27, 2025
Copy link

Warning

You have reached your daily quota limit. As a reminder, free tier users are limited to 5 requests per day. Please wait up to 24 hours and I will start processing your requests again!

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Feb 27, 2025
Comment on lines 84 to 87
class DeprecationWarning(Warning):
"""The functionality or support is being deprecated."""


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The built-in FutureWarning from Python is intended to be used for this purpose.

Suggested change
class DeprecationWarning(Warning):
"""The functionality or support is being deprecated."""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, thanks!

bigframes.constants.LEP_DEPRECATION_WARNING_MESSAGE.format(
location=location
),
category=bigframes.exceptions.DeprecationWarning,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the built-in FutureWarning.

Suggested change
category=bigframes.exceptions.DeprecationWarning,
category=FutureWarning,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@tswast tswast changed the title chore: show DeprecationWarning for LEP endpoints usage fix: prefer client_endpoints_override over use_regional_endpoints if both are provided, show FutureWarning for LEP endpoints usage Feb 27, 2025
@tswast tswast changed the title fix: prefer client_endpoints_override over use_regional_endpoints if both are provided, show FutureWarning for LEP endpoints usage fix: show FutureWarning for LEP endpoints usage with use_regional_endpoints=True Feb 27, 2025
@tswast tswast changed the title fix: show FutureWarning for LEP endpoints usage with use_regional_endpoints=True chore: show FutureWarning for LEP endpoints usage with use_regional_endpoints=True Feb 27, 2025
@tswast tswast merged commit ecbf77d into main Feb 27, 2025
23 checks passed
@tswast tswast deleted the shobs-lep-warning branch February 27, 2025 23:14
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-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants