Skip to content
Browse files
fix: error using empty array of structs parameter (#474)
* fix: error using empty array of structs parameter

* Add QueryParameterType classes

* Use query parameter types with ArrayQueryParameter

* Adjust system test to changed ArrayQueryParameter

* Clarify a comment about an assertion

Co-authored-by: Tim Swast <>

* Clarify when name/descr. is omitted from API repr

* Rename subtypes to fields

* Add fields property to StructQueryParameterType

* Add a check for empty struct fields

* Define scalar SQL parameter types as type objects

Co-authored-by: Tim Swast <>
  • Loading branch information
plamut and tswast committed Feb 24, 2021
1 parent cc3394f commit c1d15f4
Show file tree
Hide file tree
Showing 5 changed files with 711 additions and 15 deletions.
@@ -66,8 +66,11 @@
from import Model
from import ModelReference
from import ArrayQueryParameter
from import ArrayQueryParameterType
from import ScalarQueryParameter
from import ScalarQueryParameterType
from import StructQueryParameter
from import StructQueryParameterType
from import UDFResource
from import DEFAULT_RETRY
from import DeterminismLevel
@@ -93,6 +96,9 @@
# Datasets
@@ -18,6 +18,7 @@
import itertools

from import types as gapic_types
from import ScalarQueryParameterType

class Compression(object):
@@ -215,6 +216,26 @@ class SqlTypeNames(str, enum.Enum):

class SqlParameterScalarTypes:
"""Supported scalar SQL query parameter types as type objects."""

STRING = ScalarQueryParameterType("STRING")
BYTES = ScalarQueryParameterType("BYTES")
INTEGER = ScalarQueryParameterType("INT64")
INT64 = ScalarQueryParameterType("INT64")
FLOAT = ScalarQueryParameterType("FLOAT64")
FLOAT64 = ScalarQueryParameterType("FLOAT64")
NUMERIC = ScalarQueryParameterType("NUMERIC")
BIGNUMERIC = ScalarQueryParameterType("BIGNUMERIC")
BOOLEAN = ScalarQueryParameterType("BOOL")
BOOL = ScalarQueryParameterType("BOOL")
GEOGRAPHY = ScalarQueryParameterType("GEOGRAPHY")
TIMESTAMP = ScalarQueryParameterType("TIMESTAMP")
DATE = ScalarQueryParameterType("DATE")
TIME = ScalarQueryParameterType("TIME")
DATETIME = ScalarQueryParameterType("DATETIME")

class WriteDisposition(object):
"""Specifies the action that occurs if destination table already exists.

0 comments on commit c1d15f4

Please sign in to comment.