From 8223a54e731c0a4a77a38ff91f084817e434f376 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Fri, 15 Oct 2021 14:40:02 -0500 Subject: [PATCH 1/2] docs: document ScriptStatistics and other missing resource classes --- docs/job_base.rst | 5 +++++ docs/query.rst | 5 +++++ docs/reference.rst | 17 ++++++++--------- google/cloud/bigquery/job/base.py | 12 ++++++------ 4 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 docs/job_base.rst create mode 100644 docs/query.rst diff --git a/docs/job_base.rst b/docs/job_base.rst new file mode 100644 index 000000000..f5ef06b88 --- /dev/null +++ b/docs/job_base.rst @@ -0,0 +1,5 @@ +Common Job Resource Classes +=========================== + +.. automodule:: google.cloud.bigquery.job.base + :members: diff --git a/docs/query.rst b/docs/query.rst new file mode 100644 index 000000000..d3cb8fe83 --- /dev/null +++ b/docs/query.rst @@ -0,0 +1,5 @@ +Query Resource Classes +====================== + +.. automodule:: google.cloud.bigquery.query + :members: diff --git a/docs/reference.rst b/docs/reference.rst index d2d2eed31..00f64746f 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -47,7 +47,6 @@ Job Classes job.CopyJob job.LoadJob job.ExtractJob - job.UnknownJob Job-Related Types ----------------- @@ -68,7 +67,11 @@ Job-Related Types job.SourceFormat job.WriteDisposition job.SchemaUpdateOption - job.TransactionInfo + +.. toctree:: + :maxdepth: 2 + + job_base Dataset @@ -134,14 +137,10 @@ Schema Query ===== -.. autosummary:: - :toctree: generated +.. toctree:: + :maxdepth: 2 - query.ArrayQueryParameter - query.ScalarQueryParameter - query.ScalarQueryParameterType - query.StructQueryParameter - query.UDFResource + query Retries diff --git a/google/cloud/bigquery/job/base.py b/google/cloud/bigquery/job/base.py index 23c5aa8db..5b15c6b5c 100644 --- a/google/cloud/bigquery/job/base.py +++ b/google/cloud/bigquery/job/base.py @@ -19,7 +19,7 @@ import http import threading import typing -from typing import Dict, Optional +from typing import Dict, Optional, Sequence from google.api_core import exceptions import google.api_core.future.polling @@ -193,7 +193,8 @@ def parent_job_id(self): return _helpers._get_sub_prop(self._properties, ["statistics", "parentJobId"]) @property - def script_statistics(self): + def script_statistics(self) -> "ScriptStatistics": + """Statistics for a child job of a script.""" resource = _helpers._get_sub_prop( self._properties, ["statistics", "scriptStatistics"] ) @@ -968,9 +969,8 @@ def __init__(self, resource): self._properties = resource @property - def stack_frames(self): - """List[ScriptStackFrame]: Stack trace where the current evaluation - happened. + def stack_frames(self) -> Sequence[ScriptStackFrame]: + """Stack trace where the current evaluation happened. Shows line/column/procedure name of each frame on the stack at the point where the current evaluation happened. @@ -982,7 +982,7 @@ def stack_frames(self): ] @property - def evaluation_kind(self): + def evaluation_kind(self) -> Optional[str]: """str: Indicates the type of child job. Possible values include ``STATEMENT`` and ``EXPRESSION``. From 21da612fdb38247625bbe736d88d6fb18cebc6e1 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Fri, 15 Oct 2021 14:44:31 -0500 Subject: [PATCH 2/2] script_statistics can be missing --- google/cloud/bigquery/job/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/bigquery/job/base.py b/google/cloud/bigquery/job/base.py index 5b15c6b5c..9e381ded6 100644 --- a/google/cloud/bigquery/job/base.py +++ b/google/cloud/bigquery/job/base.py @@ -193,7 +193,7 @@ def parent_job_id(self): return _helpers._get_sub_prop(self._properties, ["statistics", "parentJobId"]) @property - def script_statistics(self) -> "ScriptStatistics": + def script_statistics(self) -> Optional["ScriptStatistics"]: """Statistics for a child job of a script.""" resource = _helpers._get_sub_prop( self._properties, ["statistics", "scriptStatistics"]