Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 325
chore!: remove google.cloud.bigquery_v2 code#855
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6abb8c1
chore: remove google.cloud.bigquery_v2 code
plamut f57844f
Replace proto Sql type classes with manual ones
plamut a201188
Enhance standard Sql model classes
plamut e2089b3
Adjust models code to proto classes removal
plamut c297281
Adjust Routines code to proto removals
plamut c9acea2
Adjust imports in samples code
plamut 24e3d48
Adjust assertion in get routine sample test
plamut 61e3a34
Include manual Sql types in docs
plamut ce755ab
Remove proto dependencies
plamut 199725f
Omit the generated bigquery_v2 code altogether
plamut 946c45f
Merge branch 'v3' into iss-814
tswast 6c167a7
Move SQL types a level up, expose at top level
plamut 2b1a915
Remove a comment that is not that informative
plamut c73e201
Adjust docs paths to moved SQL types
plamut d465ce6
Fix invalid Sphinx directives
plamut fa4d670
Rename TypeKind enum to StandardSqlTypeNames
plamut b2d8dca
Disable pytype false positive
plamut ced79f4
Rename StandardSqlDataTypes to StandardSqlScalarTypes
plamut 34c382a
Remove scalar SQL types enum
plamut af45ebc
Fix mis-renamed enum references in samples tests
plamut a88dc2e
Merge branch 'v3' into iss-814
plamut 6739d37
remove unused generated code loop
tswast fc31cea
🦉 Updates from OwlBot
gcf-owl-bot[bot] 6f0c55f
omit value != 0
tswast 0c986b3
remove hack for startTime
tswast cfba949
Permanently remove unneded intersphinx links
plamut b497784
🦉 Updates from OwlBot
gcf-owl-bot[bot] 8cd235d
Refactor SQL type classes to use _properties
plamut 1b29ac2
Remove validation logic from StandardSqlDataType
plamut adcaa03
Refactor SQL models to use shared state
plamut 3db7ff3
Add more informative string repr of SQL type
plamut cf562ff
Bump test coverage to 100%
plamut 026c05d
Remove unneeded dataclasses dependency
plamut 01a02ff
Update google/cloud/bigquery/model.py
tswast File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Types for Google Cloud Bigquery v2 API | ||
| ====================================== | ||
| .. automodule:: google.cloud.bigquery_v2.types | ||
| .. automodule:: google.cloud.bigquery.standard_sql | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -12,13 +12,7 @@ | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| import re | ||
| import enum | ||
| import itertools | ||
| from google.cloud.bigquery_v2 import types as gapic_types | ||
| from google.cloud.bigquery.query import ScalarQueryParameterType | ||
| class AutoRowIDs(enum.Enum): | ||
| @@ -180,56 +174,27 @@ class KeyResultStatementKind: | ||
| FIRST_SELECT = "FIRST_SELECT" | ||
| _SQL_SCALAR_TYPES = frozenset( | ||
| ( | ||
| "INT64", | ||
| "BOOL", | ||
| "FLOAT64", | ||
| "STRING", | ||
| "BYTES", | ||
| "TIMESTAMP", | ||
| "DATE", | ||
| "TIME", | ||
| "DATETIME", | ||
| "INTERVAL", | ||
| "GEOGRAPHY", | ||
| "NUMERIC", | ||
| "BIGNUMERIC", | ||
| "JSON", | ||
| ) | ||
| ) | ||
| _SQL_NONSCALAR_TYPES = frozenset(("TYPE_KIND_UNSPECIFIED", "ARRAY", "STRUCT")) | ||
| def _make_sql_scalars_enum(): | ||
| """Create an enum based on a gapic enum containing only SQL scalar types.""" | ||
| new_enum = enum.Enum( | ||
| "StandardSqlDataTypes", | ||
| ( | ||
| (member.name, member.value) | ||
| for member in gapic_types.StandardSqlDataType.TypeKind | ||
| if member.name in _SQL_SCALAR_TYPES | ||
| ), | ||
| ) | ||
| # make sure the docstring for the new enum is also correct | ||
| orig_doc = gapic_types.StandardSqlDataType.TypeKind.__doc__ | ||
| skip_pattern = re.compile( | ||
| "|".join(_SQL_NONSCALAR_TYPES) | ||
| + "|because a JSON object" # the second description line of STRUCT member | ||
| ) | ||
| new_doc = "\n".join( | ||
| itertools.filterfalse(skip_pattern.search, orig_doc.splitlines()) | ||
| ) | ||
| new_enum.__doc__ = "An Enum of scalar SQL types.\n" + new_doc | ||
| return new_enum | ||
| StandardSqlDataTypes = _make_sql_scalars_enum() | ||
| class StandardSqlTypeNames(str, enum.Enum): | ||
| def _generate_next_value_(name, start, count, last_values): | ||
| return name | ||
| TYPE_KIND_UNSPECIFIED = enum.auto() | ||
| INT64 = enum.auto() | ||
| BOOL = enum.auto() | ||
| FLOAT64 = enum.auto() | ||
| STRING = enum.auto() | ||
| BYTES = enum.auto() | ||
| TIMESTAMP = enum.auto() | ||
| DATE = enum.auto() | ||
| TIME = enum.auto() | ||
| DATETIME = enum.auto() | ||
| INTERVAL = enum.auto() | ||
| GEOGRAPHY = enum.auto() | ||
| NUMERIC = enum.auto() | ||
| BIGNUMERIC = enum.auto() | ||
| JSON = enum.auto() | ||
| ARRAY = enum.auto() | ||
| STRUCT = enum.auto() | ||
| # See also: https://cloud.google.com/bigquery/data-types#legacy_sql_data_types | ||
| @@ -256,28 +221,6 @@ class SqlTypeNames(str, enum.Enum): | ||
| DATETIME = "DATETIME" | ||
| class SqlParameterScalarTypes: | ||
plamut marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| """Supported scalar SQL query parameter types as type objects.""" | ||
| BOOL = ScalarQueryParameterType("BOOL") | ||
| BOOLEAN = ScalarQueryParameterType("BOOL") | ||
| BIGDECIMAL = ScalarQueryParameterType("BIGNUMERIC") | ||
| BIGNUMERIC = ScalarQueryParameterType("BIGNUMERIC") | ||
| BYTES = ScalarQueryParameterType("BYTES") | ||
| DATE = ScalarQueryParameterType("DATE") | ||
| DATETIME = ScalarQueryParameterType("DATETIME") | ||
| DECIMAL = ScalarQueryParameterType("NUMERIC") | ||
| FLOAT = ScalarQueryParameterType("FLOAT64") | ||
| FLOAT64 = ScalarQueryParameterType("FLOAT64") | ||
| GEOGRAPHY = ScalarQueryParameterType("GEOGRAPHY") | ||
| INT64 = ScalarQueryParameterType("INT64") | ||
| INTEGER = ScalarQueryParameterType("INT64") | ||
| NUMERIC = ScalarQueryParameterType("NUMERIC") | ||
| STRING = ScalarQueryParameterType("STRING") | ||
| TIME = ScalarQueryParameterType("TIME") | ||
| TIMESTAMP = ScalarQueryParameterType("TIMESTAMP") | ||
| class WriteDisposition(object): | ||
| """Specifies the action that occurs if destination table already exists. | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.