You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Also, we have some version comparisons for features. I think it'd be cleaner to implement these as properties like we do in BQStorageVersions that I propose adding in #748
importpackaging.version_MIN_BQ_STORAGE_VERSION=packaging.version.Version("2.0.0")
_BQ_STORAGE_OPTIONAL_READ_SESSION_VERSION=packaging.version.Version("2.6.0")
classBQStorageVersions:
def__init__(self):
self._installed_version=None@propertydefinstalled_version(
self,
) ->Union[packaging.version.LegacyVersion, packaging.version.Version]:
ifself._installed_versionisNone:
fromgoogle.cloudimportbigquery_storageself._installed_version=packaging.version.parse(
getattr(bigquery_storage, "__version__", "legacy")
)
returnself._installed_version@propertydefis_read_session_optional(self) ->bool:
returnself.installed_version>=_BQ_STORAGE_OPTIONAL_READ_SESSION_VERSIONdefverify_version(self):
"""Verify that a recent enough version of BigQuery Storage extra is installed. The function assumes that google-cloud-bigquery-storage extra is installed, and should thus be used in places where this assumption holds. Because `pip` can install an outdated version of this extra despite the constraints in setup.py, the the calling code can use this helper to verify the version compatibility at runtime. Raises: LegacyBigQueryStorageError: If google-cloud-bigquery-storage is outdated. """ifself.installed_version<_MIN_BQ_STORAGE_VERSION:
msg= (
"Dependency google-cloud-bigquery-storage is outdated, please upgrade "f"it to version >= 2.0.0 (version found: {self.installed_version})."
)
raiseLegacyBigQueryStorageError(msg)
BQ_STORAGE_VERSIONS=BQStorageVersions()
We're using
pkg_resources.parse_versionfrom setuptools, which is just a thin wrapper over packaging.Also, we have some version comparisons for features. I think it'd be cleaner to implement these as properties like we do in
BQStorageVersionsthat I propose adding in #748