forked from googleapis/google-cloud-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate protos for Models API. (googleapis#488)
* Generate protos for Models API. The Models API is a component of the bigquery_v2 interface. It is not available as a gRPC API, but it does provide protocol buffers. This commit adds those protocol buffers to the client so that they can be used to avoid much manual work to create resource classes that can be serialized to/from JSON.
- Loading branch information
Showing
24 changed files
with
4,643 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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 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,3 +1,5 @@ | ||
include README.rst LICENSE | ||
recursive-include google *.json *.proto | ||
recursive-include tests * | ||
global-exclude *.pyc __pycache__ | ||
global-exclude *.py[co] | ||
global-exclude __pycache__ |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Types for BigQuery API Client | ||
============================= | ||
|
||
.. automodule:: google.cloud.bigquery_v2.types | ||
:members: |
This file contains 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 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 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
Empty file.
This file contains 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 |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2019 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Wrappers for protocol buffer enum types.""" | ||
|
||
import enum | ||
|
||
|
||
class Model(object): | ||
class DataSplitMethod(enum.IntEnum): | ||
""" | ||
Indicates the method to split input data into multiple tables. | ||
Attributes: | ||
DATA_SPLIT_METHOD_UNSPECIFIED (int) | ||
RANDOM (int): Splits data randomly. | ||
CUSTOM (int): Splits data with the user provided tags. | ||
SEQUENTIAL (int): Splits data sequentially. | ||
NO_SPLIT (int): Data split will be skipped. | ||
AUTO_SPLIT (int): Splits data automatically: Uses NO\_SPLIT if the data size is small. | ||
Otherwise uses RANDOM. | ||
""" | ||
|
||
DATA_SPLIT_METHOD_UNSPECIFIED = 0 | ||
RANDOM = 1 | ||
CUSTOM = 2 | ||
SEQUENTIAL = 3 | ||
NO_SPLIT = 4 | ||
AUTO_SPLIT = 5 | ||
|
||
class LearnRateStrategy(enum.IntEnum): | ||
""" | ||
Indicates the learning rate optimization strategy to use. | ||
Attributes: | ||
LEARN_RATE_STRATEGY_UNSPECIFIED (int) | ||
LINE_SEARCH (int): Use line search to determine learning rate. | ||
CONSTANT (int): Use a constant learning rate. | ||
""" | ||
|
||
LEARN_RATE_STRATEGY_UNSPECIFIED = 0 | ||
LINE_SEARCH = 1 | ||
CONSTANT = 2 | ||
|
||
class LossType(enum.IntEnum): | ||
""" | ||
Loss metric to evaluate model training performance. | ||
Attributes: | ||
LOSS_TYPE_UNSPECIFIED (int) | ||
MEAN_SQUARED_LOSS (int): Mean squared loss, used for linear regression. | ||
MEAN_LOG_LOSS (int): Mean log loss, used for logistic regression. | ||
""" | ||
|
||
LOSS_TYPE_UNSPECIFIED = 0 | ||
MEAN_SQUARED_LOSS = 1 | ||
MEAN_LOG_LOSS = 2 | ||
|
||
class ModelType(enum.IntEnum): | ||
""" | ||
Indicates the type of the Model. | ||
Attributes: | ||
MODEL_TYPE_UNSPECIFIED (int) | ||
LINEAR_REGRESSION (int): Linear regression model. | ||
LOGISTIC_REGRESSION (int): Logistic regression model. | ||
""" | ||
|
||
MODEL_TYPE_UNSPECIFIED = 0 | ||
LINEAR_REGRESSION = 1 | ||
LOGISTIC_REGRESSION = 2 | ||
|
||
|
||
class StandardSqlDataType(object): | ||
class TypeKind(enum.IntEnum): | ||
""" | ||
Attributes: | ||
TYPE_KIND_UNSPECIFIED (int): Invalid type. | ||
INT64 (int): Encoded as a string in decimal format. | ||
BOOL (int): Encoded as a boolean "false" or "true". | ||
FLOAT64 (int): Encoded as a number, or string "NaN", "Infinity" or "-Infinity". | ||
STRING (int): Encoded as a string value. | ||
BYTES (int): Encoded as a base64 string per RFC 4648, section 4. | ||
TIMESTAMP (int): Encoded as an RFC 3339 timestamp with mandatory "Z" time zone string: | ||
1985-04-12T23:20:50.52Z | ||
DATE (int): Encoded as RFC 3339 full-date format string: 1985-04-12 | ||
TIME (int): Encoded as RFC 3339 partial-time format string: 23:20:50.52 | ||
DATETIME (int): Encoded as RFC 3339 full-date "T" partial-time: 1985-04-12T23:20:50.52 | ||
GEOGRAPHY (int): Encoded as WKT | ||
NUMERIC (int): Encoded as a decimal string. | ||
ARRAY (int): Encoded as a list with types matching Type.array\_type. | ||
STRUCT (int): Encoded as a list with fields of type Type.struct\_type[i]. List is used | ||
because a JSON object cannot have duplicate field names. | ||
""" | ||
|
||
TYPE_KIND_UNSPECIFIED = 0 | ||
INT64 = 2 | ||
BOOL = 5 | ||
FLOAT64 = 7 | ||
STRING = 8 | ||
BYTES = 9 | ||
TIMESTAMP = 19 | ||
DATE = 10 | ||
TIME = 20 | ||
DATETIME = 21 | ||
GEOGRAPHY = 22 | ||
NUMERIC = 23 | ||
ARRAY = 16 | ||
STRUCT = 17 |
Empty file.
34 changes: 34 additions & 0 deletions
34
bigquery/google/cloud/bigquery_v2/proto/location_metadata.proto
This file contains 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2019 Google LLC. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
syntax = "proto3"; | ||
|
||
package google.cloud.bigquery.v2; | ||
|
||
import "google/api/annotations.proto"; | ||
|
||
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigquery"; | ||
option java_outer_classname = "LocationMetadataProto"; | ||
option java_package = "com.google.cloud.bigquery.v2"; | ||
|
||
|
||
// BigQuery-specific metadata about a location. This will be set on | ||
// google.cloud.location.Location.metadata in Cloud Location API | ||
// responses. | ||
message LocationMetadata { | ||
// The legacy BigQuery location ID, e.g. “EU” for the “europe” location. | ||
// This is for any API consumers that need the legacy “US” and “EU” locations. | ||
string legacy_location_id = 1; | ||
} |
98 changes: 98 additions & 0 deletions
98
bigquery/google/cloud/bigquery_v2/proto/location_metadata_pb2.py
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
bigquery/google/cloud/bigquery_v2/proto/location_metadata_pb2_grpc.py
This file contains 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
import grpc |
Oops, something went wrong.