Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: document ScriptStatistics and other missing resource classes (#…
…1023)

While implementing Sessions, I noticed several missing classes in the reference docs.

Using "automodule" since experience has shown we often forget to add new classes to `docs/reference.rst`.
  • Loading branch information
tswast committed Oct 15, 2021
1 parent 2937fa1 commit 6679109
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
5 changes: 5 additions & 0 deletions docs/job_base.rst
@@ -0,0 +1,5 @@
Common Job Resource Classes
===========================

.. automodule:: google.cloud.bigquery.job.base
:members:
5 changes: 5 additions & 0 deletions docs/query.rst
@@ -0,0 +1,5 @@
Query Resource Classes
======================

.. automodule:: google.cloud.bigquery.query
:members:
17 changes: 8 additions & 9 deletions docs/reference.rst
Expand Up @@ -47,7 +47,6 @@ Job Classes
job.CopyJob
job.LoadJob
job.ExtractJob
job.UnknownJob

Job-Related Types
-----------------
Expand All @@ -68,7 +67,11 @@ Job-Related Types
job.SourceFormat
job.WriteDisposition
job.SchemaUpdateOption
job.TransactionInfo

.. toctree::
:maxdepth: 2

job_base


Dataset
Expand Down Expand Up @@ -134,14 +137,10 @@ Schema
Query
=====

.. autosummary::
:toctree: generated
.. toctree::
:maxdepth: 2

query.ArrayQueryParameter
query.ScalarQueryParameter
query.ScalarQueryParameterType
query.StructQueryParameter
query.UDFResource
query


Retries
Expand Down
12 changes: 6 additions & 6 deletions google/cloud/bigquery/job/base.py
Expand Up @@ -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
Expand Down Expand Up @@ -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) -> Optional["ScriptStatistics"]:
"""Statistics for a child job of a script."""
resource = _helpers._get_sub_prop(
self._properties, ["statistics", "scriptStatistics"]
)
Expand Down Expand Up @@ -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.
Expand All @@ -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``.
Expand Down

0 comments on commit 6679109

Please sign in to comment.