Skip to content

Commit 2de3bc1

Browse files
committed
Merge remote-tracking branch 'origin/main' into bump-grpcio
2 parents bbe965e + af19393 commit 2de3bc1

35 files changed

Lines changed: 1514 additions & 355 deletions

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:234b9d1f2ddb057ed7ac6a38db0bf8163d839c65c6cf88ade52530cddebce59e
1515
libraries:
1616
- id: bigframes
17-
version: 2.42.0
17+
version: 2.43.0
1818
last_generated_commit: ""
1919
apis: []
2020
source_roots:

librarian.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ default:
5858
library_type: GAPIC_AUTO
5959
libraries:
6060
- name: bigframes
61-
version: 2.42.0
61+
version: 2.43.0
6262
skip_release: true
6363
python:
6464
library_type: INTEGRATION

packages/bigframes/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44

55
[1]: https://pypi.org/project/bigframes/#history
66

7+
## [2.43.0](https://github.com/googleapis/google-cloud-python/compare/bigframes-v2.42.0...bigframes-v2.43.0) (2026-06-12)
8+
9+
10+
### Documentation
11+
12+
* add a notebook explaining bqsql magics cell chaining (#17216) ([1a0de4a7701b7fdf4c2593b1960f1194ebc49793](https://github.com/googleapis/google-cloud-python/commit/1a0de4a7701b7fdf4c2593b1960f1194ebc49793))
13+
14+
15+
### Features
16+
17+
* add `bigframes.bigquery.bit_count` and conversion scalar function (#17433) ([7f29823fadb3cff42dbe666f8c7aa33bab3c7021](https://github.com/googleapis/google-cloud-python/commit/7f29823fadb3cff42dbe666f8c7aa33bab3c7021))
18+
19+
20+
### Bug Fixes
21+
22+
* preserve aliases on cast columns and fix star selection in sqlglot (#17394) (#17455) ([145034a345eb3e14ea3f23dfcafa3d2409a09067](https://github.com/googleapis/google-cloud-python/commit/145034a345eb3e14ea3f23dfcafa3d2409a09067))
23+
* bump pyarrow from 15.0.2 to 23.0.1 in /packages/bigframes (#17386) ([f59c2b2aa61316cf04b650933036ef50f6a1f08c](https://github.com/googleapis/google-cloud-python/commit/f59c2b2aa61316cf04b650933036ef50f6a1f08c))
24+
* improve error message when unescaped `{` are found in SQL cells (#17346) ([3a90cc8e867c8a2d2f8060858fde9eda94f80a54](https://github.com/googleapis/google-cloud-python/commit/3a90cc8e867c8a2d2f8060858fde9eda94f80a54))
25+
726
## [2.42.0](https://github.com/googleapis/google-cloud-python/compare/bigframes-v2.41.0...bigframes-v2.42.0) (2026-06-08)
827

928

packages/bigframes/bigframes/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "2.42.0"
15+
__version__ = "2.43.0"
1616

1717
# {x-release-please-start-date}
18-
__release_date__ = "2026-06-08"
18+
__release_date__ = "2026-06-12"
1919
# {x-release-please-end}

packages/bigframes/third_party/bigframes_vendored/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "2.42.0"
15+
__version__ = "2.43.0"
1616

1717
# {x-release-please-start-date}
18-
__release_date__ = "2026-06-08"
18+
__release_date__ = "2026-06-12"
1919
# {x-release-please-end}

packages/google-api-core/tests/unit/test_python_version_support.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import pytest
1615
import datetime
1716
import textwrap
1817
import warnings
1918
from collections import namedtuple
20-
2119
from unittest.mock import patch
2220

21+
import pytest
22+
2323
# Code to be tested
2424
from google.api_core._python_version_support import (
25+
PYTHON_VERSION_INFO,
26+
PythonVersionStatus,
2527
_flatten_message,
2628
check_python_version,
27-
PythonVersionStatus,
28-
PYTHON_VERSION_INFO,
2929
)
3030

3131
# Helper object for mocking sys.version_info
@@ -65,10 +65,12 @@ def _create_failure_message(
6565
)
6666

6767

68-
def generate_tracked_version_test_cases():
68+
def get_tracked_version_test_cases():
6969
"""
70-
Yields test parameters for all tracked versions and boundary conditions.
70+
Returns a list of test parameters for all tracked versions and boundary conditions.
7171
"""
72+
results = []
73+
7274
for version_tuple, version_info in PYTHON_VERSION_INFO.items():
7375
py_version_str = f"{version_tuple[0]}.{version_tuple[1]}"
7476
gapic_dep = version_info.gapic_deprecation or (
@@ -111,20 +113,23 @@ def generate_tracked_version_test_cases():
111113
}
112114

113115
for name, params in test_cases.items():
114-
yield pytest.param(
115-
version_tuple,
116-
params["date"],
117-
params["expected"],
118-
gapic_dep,
119-
gapic_end,
120-
eol_warning_starts,
121-
id=f"{py_version_str}-{name}",
116+
results.append(
117+
pytest.param(
118+
version_tuple,
119+
params["date"],
120+
params["expected"],
121+
gapic_dep,
122+
gapic_end,
123+
eol_warning_starts,
124+
id=f"{py_version_str}-{name}",
125+
)
122126
)
127+
return results
123128

124129

125130
@pytest.mark.parametrize(
126131
"version_tuple, mock_date, expected_status, gapic_dep, gapic_end, eol_warning_starts",
127-
generate_tracked_version_test_cases(),
132+
get_tracked_version_test_cases(),
128133
)
129134
def test_all_tracked_versions_and_date_scenarios(
130135
version_tuple, mock_date, expected_status, gapic_dep, gapic_end, eol_warning_starts

packages/google-auth/README.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@ Supported Python Versions
3737
^^^^^^^^^^^^^^^^^^^^^^^^^
3838
Python >= 3.10
3939

40-
Unsupported Python Versions
41-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
42-
- Python == 2.7: The last version of this library with support for Python 2.7
43-
was `google.auth == 1.34.0`.
44-
45-
- Python 3.5: The last version of this library with support for Python 3.5
46-
was `google.auth == 1.23.0`.
47-
48-
- Python 3.6: The last version of this library with support for Python 3.6
49-
was `google.auth == 2.22.0`.
50-
51-
- Python 3.7: The last version of this library with support for Python 3.7
52-
was `google.auth == 2.45.0`.
5340

5441

5542
Documentation

packages/google-auth/google/auth/_regional_access_boundary_utils.py

Lines changed: 85 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,18 @@
2020
import functools
2121
import inspect
2222
import logging
23-
import os
2423
import threading
2524
from typing import NamedTuple, Optional, TYPE_CHECKING
2625

2726
from google.auth import _helpers
28-
from google.auth import environment_vars
2927

30-
if TYPE_CHECKING:
28+
if TYPE_CHECKING: # pragma: NO COVER
3129
import google.auth.credentials
3230
import google.auth.transport
3331

3432
_LOGGER = logging.getLogger(__name__)
3533

3634

37-
@functools.lru_cache()
38-
def is_regional_access_boundary_enabled():
39-
"""Checks if Regional Access Boundary is enabled via environment variable.
40-
41-
The environment variable is interpreted as a boolean with the following
42-
(case-insensitive) rules:
43-
- "true", "1" are considered true.
44-
- Any other value (or unset) is considered false.
45-
46-
Returns:
47-
bool: True if Regional Access Boundary is enabled, False otherwise.
48-
"""
49-
value = os.environ.get(environment_vars.GOOGLE_AUTH_TRUST_BOUNDARY_ENABLED)
50-
if value is None:
51-
return False
52-
53-
return value.lower() in ("true", "1")
54-
55-
5635
# The default lifetime for a cached Regional Access Boundary.
5736
DEFAULT_REGIONAL_ACCESS_BOUNDARY_TTL = datetime.timedelta(hours=6)
5837

@@ -455,6 +434,61 @@ def start_refresh(self, credentials, request, rab_manager):
455434
self._worker.start()
456435

457436

437+
def _prepare_async_lookup_callable(request):
438+
"""Unwraps a request callable, clones the transport, and returns the new callable.
439+
440+
Args:
441+
request: The original request callable (e.g. functools.partial or raw Request).
442+
443+
Returns:
444+
Tuple[Callable, Any, bool]: A tuple containing the new lookup callable, the
445+
underlying request object, and a boolean indicating if it was cloned.
446+
"""
447+
is_partial = isinstance(request, functools.partial)
448+
base_callable = request.func if is_partial else request
449+
450+
if not hasattr(base_callable, "_clone"):
451+
return request, base_callable, False
452+
453+
cloned_callable = base_callable._clone()
454+
is_cloned = cloned_callable is not base_callable
455+
456+
if is_partial:
457+
new_request = functools.partial(
458+
cloned_callable, *request.args, **request.keywords
459+
)
460+
else:
461+
new_request = cloned_callable
462+
463+
return new_request, cloned_callable, is_cloned
464+
465+
466+
async def _close_cloned_request(lookup_request, is_cloned):
467+
"""Safely closes the underlying cloned request transport, if applicable.
468+
469+
Args:
470+
lookup_request (Any): The request object/transport to close.
471+
is_cloned (bool): Whether the request was actually cloned.
472+
"""
473+
if not is_cloned or not hasattr(lookup_request, "close"):
474+
return
475+
476+
is_async = False
477+
try:
478+
maybe_coro = lookup_request.close()
479+
if is_async := inspect.isawaitable(maybe_coro):
480+
await maybe_coro
481+
except Exception as e:
482+
if _helpers.is_logging_enabled(_LOGGER):
483+
adapter_type = " asynchronous " if is_async else " "
484+
_LOGGER.warning(
485+
"Failed to cleanly close cloned%srequest transport: %s",
486+
adapter_type,
487+
e,
488+
exc_info=True,
489+
)
490+
491+
458492
class _AsyncRegionalAccessBoundaryRefreshManager(object):
459493
"""Manages a task for background refreshing of the Regional Access Boundary in async flows."""
460494

@@ -491,11 +525,28 @@ def start_refresh(self, credentials, request, rab_manager):
491525
# A refresh is already in progress.
492526
return
493527

528+
try:
529+
(
530+
lookup_callable,
531+
lookup_request,
532+
is_cloned,
533+
) = _prepare_async_lookup_callable(request)
534+
except Exception as e:
535+
if _helpers.is_logging_enabled(_LOGGER):
536+
_LOGGER.warning(
537+
"Synchronous cloning of request for Regional Access Boundary lookup failed: %s",
538+
e,
539+
exc_info=True,
540+
)
541+
rab_manager.process_regional_access_boundary_info(None)
542+
return
543+
494544
async def _worker():
495545
try:
496-
# credentials._lookup_regional_access_boundary should be async in the async creds class
497546
regional_access_boundary_info = (
498-
await credentials._lookup_regional_access_boundary(request)
547+
await credentials._lookup_regional_access_boundary(
548+
lookup_callable
549+
)
499550
)
500551
except Exception as e:
501552
if _helpers.is_logging_enabled(_LOGGER):
@@ -505,6 +556,8 @@ async def _worker():
505556
exc_info=True,
506557
)
507558
regional_access_boundary_info = None
559+
finally:
560+
await _close_cloned_request(lookup_request, is_cloned)
508561

509562
rab_manager.process_regional_access_boundary_info(
510563
regional_access_boundary_info
@@ -514,7 +567,15 @@ async def _worker():
514567
try:
515568
self._worker_task = asyncio.create_task(coro)
516569
except Exception:
570+
# Clean up cloned request if task creation fails
517571
coro.close()
572+
try:
573+
asyncio.get_running_loop().create_task(
574+
_close_cloned_request(lookup_request, is_cloned)
575+
)
576+
except RuntimeError:
577+
pass
578+
rab_manager.process_regional_access_boundary_info(None)
518579
raise
519580

520581

packages/google-auth/google/auth/aio/transport/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,13 @@ async def close(self) -> None:
142142
Close the underlying session.
143143
"""
144144
raise NotImplementedError("close must be implemented.")
145+
146+
def _clone(self) -> "Request":
147+
"""Creates a copy of this request adapter.
148+
149+
The base implementation returns `self` (an identical shared instance).
150+
Transport adapters that maintain internal connection pools or stateful
151+
sessions must override this method to return an independent, detached
152+
adapter instance.
153+
"""
154+
return self

0 commit comments

Comments
 (0)