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(bigquery): consistent use of optional keyword #153

Merged
merged 2 commits into from Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions google/cloud/bigquery/_helpers.py
Expand Up @@ -471,16 +471,16 @@ def _get_sub_prop(container, keys, default=None):

This method works like ``dict.get(key)``, but for nested values.

Arguments:
Args:
container (Dict):
A dictionary which may contain other dictionaries as values.
keys (Iterable):
A sequence of keys to attempt to get the value for. Each item in
the sequence represents a deeper nesting. The first key is for
the top level. If there is a dictionary there, the second key
attempts to get the value within that, and so on.
default (object):
(Optional) Value to returned if any of the keys are not found.
default (Optional[object]):
Value to returned if any of the keys are not found.
Defaults to ``None``.

Examples:
Expand Down Expand Up @@ -514,7 +514,7 @@ def _get_sub_prop(container, keys, default=None):
def _set_sub_prop(container, keys, value):
"""Set a nested value in a dictionary.

Arguments:
Args:
container (Dict):
A dictionary which may contain other dictionaries as values.
keys (Iterable):
Expand Down Expand Up @@ -557,7 +557,7 @@ def _set_sub_prop(container, keys, value):
def _del_sub_prop(container, keys):
"""Remove a nested key fro a dictionary.

Arguments:
Args:
container (Dict):
A dictionary which may contain other dictionaries as values.
keys (Iterable):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigquery/_http.py
Expand Up @@ -25,7 +25,7 @@ class Connection(_http.JSONConnection):
Args:
client (google.cloud.bigquery.client.Client): The client that owns the current connection.

client_info (google.api_core.client_info.ClientInfo): (Optional) instance used to generate user agent.
client_info (Optional[google.api_core.client_info.ClientInfo]): Instance used to generate user agent.
"""

DEFAULT_API_ENDPOINT = "https://bigquery.googleapis.com"
Expand Down
7 changes: 3 additions & 4 deletions google/cloud/bigquery/_pandas_helpers.py
Expand Up @@ -472,10 +472,9 @@ def dataframe_to_parquet(dataframe, bq_schema, filepath, parquet_compression="SN
columns in the DataFrame.
filepath (str):
Path to write Parquet file to.
parquet_compression (str):
(optional) The compression codec to use by the the
``pyarrow.parquet.write_table`` serializing method. Defaults to
"SNAPPY".
parquet_compression (Optional[str]):
The compression codec to use by the the ``pyarrow.parquet.write_table``
serializing method. Defaults to "SNAPPY".
https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_table.html#pyarrow-parquet-write-table
"""
if pyarrow is None:
Expand Down
449 changes: 216 additions & 233 deletions google/cloud/bigquery/client.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions google/cloud/bigquery/dataset.py
Expand Up @@ -295,9 +295,9 @@ def from_string(cls, dataset_id, default_project=None):
A dataset ID in standard SQL format. If ``default_project``
is not specified, this must include both the project ID and
the dataset ID, separated by ``.``.
default_project (str):
Optional. The project ID to use when ``dataset_id`` does not
include a project ID.
default_project (Optional[str]):
The project ID to use when ``dataset_id`` does not include a
project ID.

Returns:
DatasetReference:
Expand Down