diff --git a/google/cloud/bigquery_v2/types/__init__.py b/google/cloud/bigquery_v2/types/__init__.py index c038bcd74..c36b30969 100644 --- a/google/cloud/bigquery_v2/types/__init__.py +++ b/google/cloud/bigquery_v2/types/__init__.py @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .encryption_config import EncryptionConfiguration +from .encryption_config import ( + EncryptionConfiguration, +) from .model import ( DeleteModelRequest, GetModelRequest, @@ -22,14 +24,18 @@ Model, PatchModelRequest, ) -from .model_reference import ModelReference +from .model_reference import ( + ModelReference, +) from .standard_sql import ( StandardSqlDataType, StandardSqlField, StandardSqlStructType, StandardSqlTableType, ) -from .table_reference import TableReference +from .table_reference import ( + TableReference, +) __all__ = ( "EncryptionConfiguration", diff --git a/google/cloud/bigquery_v2/types/model.py b/google/cloud/bigquery_v2/types/model.py index 7786d8ea4..f32e15eb1 100644 --- a/google/cloud/bigquery_v2/types/model.py +++ b/google/cloud/bigquery_v2/types/model.py @@ -55,7 +55,7 @@ class Model(proto.Message): model. friendly_name (str): Optional. A descriptive name for this model. - labels (Sequence[google.cloud.bigquery_v2.types.Model.LabelsEntry]): + labels (Mapping[str, str]): The labels associated with this model. You can use these to organize and group your models. Label keys and values can be no longer than 63 @@ -1200,7 +1200,7 @@ class TrainingOptions(proto.Message): initial_learn_rate (float): Specifies the initial learning rate for the line search learn rate strategy. - label_class_weights (Sequence[google.cloud.bigquery_v2.types.Model.TrainingRun.TrainingOptions.LabelClassWeightsEntry]): + label_class_weights (Mapping[str, float]): Weights associated with each label class, for rebalancing the training data. Only applicable for classification models. diff --git a/owlbot.py b/owlbot.py index 046280501..ca96f4e08 100644 --- a/owlbot.py +++ b/owlbot.py @@ -19,6 +19,25 @@ from synthtool import gcp from synthtool.languages import python +default_version = "v2" + +for library in s.get_staging_dirs(default_version): + # Avoid breaking change due to change in field renames. + # https://github.com/googleapis/python-bigquery/issues/319 + s.replace( + library / f"google/cloud/bigquery_{library.name}/types/standard_sql.py", + r"type_ ", + "type ", + ) + # Patch docs issue + s.replace( + library / f"google/cloud/bigquery_{library.name}/types/model.py", + r"""\"predicted_\"""", + """`predicted_`""", + ) + s.move(library / f"google/cloud/bigquery_{library.name}/types") +s.remove_staging_dirs() + common = gcp.CommonTemplates() # ----------------------------------------------------------------------------