Skip to content

Commit a46df64

Browse files
authored
docs: improve bigquery_destination_prefix docstring (#1098)
Fixes b/186678558 🦕 Updated the `bigquery_destination_prefix` docstring in `models.py` and `jobs.py` to clarify that both a BQ project URI and full BQ table URI are acceptable inputs.
1 parent b075e85 commit a46df64

File tree

2 files changed

+42
-36
lines changed

2 files changed

+42
-36
lines changed

google/cloud/aiplatform/jobs.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -431,24 +431,27 @@ def create(
431431
which as value has ```google.rpc.Status`` <Status>`__
432432
containing only ``code`` and ``message`` fields.
433433
bigquery_destination_prefix (Optional[str]):
434-
The BigQuery project location where the output is to be
435-
written to. In the given project a new dataset is created
436-
with name
437-
``prediction_<model-display-name>_<job-create-time>`` where
438-
is made BigQuery-dataset-name compatible (for example, most
439-
special characters become underscores), and timestamp is in
440-
YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the
441-
dataset two tables will be created, ``predictions``, and
442-
``errors``. If the Model has both ``instance`` and ``prediction``
443-
schemata defined then the tables have columns as follows:
444-
The ``predictions`` table contains instances for which the
445-
prediction succeeded, it has columns as per a concatenation
446-
of the Model's instance and prediction schemata. The
447-
``errors`` table contains rows for which the prediction has
448-
failed, it has instance columns, as per the instance schema,
449-
followed by a single "errors" column, which as values has
450-
```google.rpc.Status`` <Status>`__ represented as a STRUCT,
451-
and containing only ``code`` and ``message``.
434+
The BigQuery URI to a project or table, up to 2000 characters long.
435+
When only the project is specified, the Dataset and Table is created.
436+
When the full table reference is specified, the Dataset must exist and
437+
table must not exist. Accepted forms: ``bq://projectId`` or
438+
``bq://projectId.bqDatasetId`` or
439+
``bq://projectId.bqDatasetId.bqTableId``. If no Dataset is specified,
440+
a new one is created with the name
441+
``prediction_<model-display-name>_<job-create-time>``
442+
where the table name is made BigQuery-dataset-name compatible
443+
(for example, most special characters become underscores), and
444+
timestamp is in YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601"
445+
format. In the dataset two tables will be created, ``predictions``,
446+
and ``errors``. If the Model has both ``instance`` and
447+
``prediction`` schemata defined then the tables have columns as
448+
follows: The ``predictions`` table contains instances for which
449+
the prediction succeeded, it has columns as per a concatenation
450+
of the Model's instance and prediction schemata. The ``errors``
451+
table contains rows for which the prediction has failed, it has
452+
instance columns, as per the instance schema, followed by a single
453+
"errors" column, which as values has ```google.rpc.Status`` <Status>`__
454+
represented as a STRUCT, and containing only ``code`` and ``message``.
452455
model_parameters (Optional[Dict]):
453456
The parameters that govern the predictions. The schema of
454457
the parameters may be specified via the Model's `parameters_schema_uri`.

google/cloud/aiplatform/models.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,24 +2273,27 @@ def batch_predict(
22732273
which as value has ```google.rpc.Status`` <Status>`__
22742274
containing only ``code`` and ``message`` fields.
22752275
bigquery_destination_prefix: Optional[str] = None
2276-
The BigQuery project location where the output is to be
2277-
written to. In the given project a new dataset is created
2278-
with name
2279-
``prediction_<model-display-name>_<job-create-time>`` where
2280-
is made BigQuery-dataset-name compatible (for example, most
2281-
special characters become underscores), and timestamp is in
2282-
YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the
2283-
dataset two tables will be created, ``predictions``, and
2284-
``errors``. If the Model has both ``instance`` and ``prediction``
2285-
schemata defined then the tables have columns as follows:
2286-
The ``predictions`` table contains instances for which the
2287-
prediction succeeded, it has columns as per a concatenation
2288-
of the Model's instance and prediction schemata. The
2289-
``errors`` table contains rows for which the prediction has
2290-
failed, it has instance columns, as per the instance schema,
2291-
followed by a single "errors" column, which as values has
2292-
```google.rpc.Status`` <Status>`__ represented as a STRUCT,
2293-
and containing only ``code`` and ``message``.
2276+
The BigQuery URI to a project or table, up to 2000 characters long.
2277+
When only the project is specified, the Dataset and Table is created.
2278+
When the full table reference is specified, the Dataset must exist and
2279+
table must not exist. Accepted forms: ``bq://projectId`` or
2280+
``bq://projectId.bqDatasetId`` or
2281+
``bq://projectId.bqDatasetId.bqTableId``. If no Dataset is specified,
2282+
a new one is created with the name
2283+
``prediction_<model-display-name>_<job-create-time>``
2284+
where the table name is made BigQuery-dataset-name compatible
2285+
(for example, most special characters become underscores), and
2286+
timestamp is in YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601"
2287+
format. In the dataset two tables will be created, ``predictions``,
2288+
and ``errors``. If the Model has both ``instance`` and
2289+
``prediction`` schemata defined then the tables have columns as
2290+
follows: The ``predictions`` table contains instances for which
2291+
the prediction succeeded, it has columns as per a concatenation
2292+
of the Model's instance and prediction schemata. The ``errors``
2293+
table contains rows for which the prediction has failed, it has
2294+
instance columns, as per the instance schema, followed by a single
2295+
"errors" column, which as values has ```google.rpc.Status`` <Status>`__
2296+
represented as a STRUCT, and containing only ``code`` and ``message``.
22942297
predictions_format: str = "jsonl"
22952298
Required. The format in which Vertex AI outputs the
22962299
predictions, must be one of the formats specified in

0 commit comments

Comments
 (0)