Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add/reformat return types for cloud RAD docs #1582

Merged
merged 2 commits into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions google/cloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ def get_service_account_email(
before using ``retry``.

Returns:
str: service account email address
str:
service account email address

Example:

Expand Down Expand Up @@ -1932,7 +1933,8 @@ def job_from_resource(
resource (Dict): one job resource from API response

Returns:
The job instance, constructed via the resource.
Union[job.CopyJob, job.ExtractJob, job.LoadJob, job.QueryJob, job.UnknownJob]:
The job instance, constructed via the resource.
"""
config = resource.get("configuration", {})
if "load" in config:
Expand Down Expand Up @@ -2064,7 +2066,8 @@ def get_job(
before using ``retry``.

Returns:
Job instance, based on the resource returned by the API.
Union[job.LoadJob, job.CopyJob, job.ExtractJob, job.QueryJob, job.UnknownJob]:
Job instance, based on the resource returned by the API.
"""
extra_params = {"projection": "full"}

Expand Down Expand Up @@ -3954,12 +3957,13 @@ def _schema_to_json_file_object(self, schema_list, file_obj):
"""
json.dump(schema_list, file_obj, indent=2, sort_keys=True)

def schema_from_json(self, file_or_path: "PathType"):
def schema_from_json(self, file_or_path: "PathType") -> List[SchemaField]:
"""Takes a file object or file path that contains json that describes
a table schema.

Returns:
List of schema field objects.
List[SchemaField]:
List of :class:`~google.cloud.bigquery.schema.SchemaField` objects.
"""
if isinstance(file_or_path, io.IOBase):
return self._schema_from_json_file_object(file_or_path)
Expand Down