Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
261c969
Renaming gcloud/ directory to google/cloud/.
dhermes Sep 3, 2016
e55a1d8
Renaming "import gcloud" statements as google.cloud.
dhermes Sep 3, 2016
416071b
Renaming "from gcloud import *" statements as google.cloud.
dhermes Sep 3, 2016
835578f
Renaming ">>> from gcloud.foo.bar import *" statements as google.cloud.
dhermes Sep 3, 2016
d05a9d4
Updating gcloud->google.cloud imports in gRPC rewrite scripts.
dhermes Sep 3, 2016
822e719
Rename remaining "gcloud" imports as "google.cloud".
dhermes Sep 3, 2016
ab18ce8
Renaming mentions of "gcloud-python" as "google-cloud-python".
dhermes Sep 3, 2016
c13d2ec
Renaming mentions of "hack-on-gcloud" as "hack-on-google-cloud-python".
dhermes Sep 3, 2016
f29999a
Renaming mentions of "gcloud" docs automodules as "google.cloud".
dhermes Sep 3, 2016
f12fee4
Renaming docs mentions of "gcloud" as "google-cloud".
dhermes Sep 3, 2016
ae89f77
Renaming docs path in JSON docs (gcloud->google/cloud).
dhermes Sep 3, 2016
381d236
Replacing usage of gcloud with google-cloud in docs config.
dhermes Sep 3, 2016
3649f3a
Replacing gcloud with google-cloud in scripts directory.
dhermes Sep 3, 2016
ab59f8d
Renaming all GCLOUD_* env. vars. as GOOGLE_CLOUD_*.
dhermes Sep 3, 2016
e12cc95
Renaming all GCloudError as GoogleCloudError.
dhermes Sep 3, 2016
faab61c
Renaming all ~gcloud references as google.cloud.
dhermes Sep 3, 2016
5910b22
Cleaning up remaining renames of gcloud->google-cloud.
dhermes Aug 29, 2016
e6139ac
Adding __init__.py to make google/ a package.
dhermes Sep 3, 2016
73d2986
Adding __init__.py to make google/ a package.
dhermes Aug 30, 2016
adf5e21
Fixing lint issues after package rename.
dhermes Aug 30, 2016
e03a7f8
Fixing docs issues after package rename.
dhermes Sep 3, 2016
c2c9f4d
Updating coveragerc omit section for namespace collisions.
dhermes Sep 3, 2016
4534d9a
Restoring most services as non-namespace packages.
dhermes Sep 6, 2016
fee8d0d
Removing json-docs from Travis config.
dhermes Sep 6, 2016
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
4 changes: 2 additions & 2 deletions docs/bigquery_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""Testable usage examples for Google Cloud BigQuery API wrapper

Each example function takes a ``client`` argument (which must be an instance
of :class:`google.cloud.bigquery.client.Client`) and uses it to perform a task with
the API.
of :class:`google.cloud.bigquery.client.Client`) and uses it to perform a task
with the API.

To facilitate running the examples as system tests, each example is also passed
a ``to_delete`` list; the function adds to the list any objects created which
Expand Down
4 changes: 2 additions & 2 deletions docs/pubsub_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""Testable usage examples for Google Cloud Pubsub API wrapper

Each example function takes a ``client`` argument (which must be an instance
of :class:`google.cloud.pubsub.client.Client`) and uses it to perform a task with
the API.
of :class:`google.cloud.pubsub.client.Client`) and uses it to perform a task
with the API.

To facilitate running the examples as system tests, each example is also passed
a ``to_delete`` list; the function adds to the list any objects created which
Expand Down
2 changes: 2 additions & 0 deletions google/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Base ``google`` namespace package."""

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
Expand Down
16 changes: 9 additions & 7 deletions google/cloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
from six.moves.http_client import HTTPConnection
from six.moves import configparser

# pylint: disable=ungrouped-imports
from google.cloud.environment_vars import PROJECT
from google.cloud.environment_vars import CREDENTIALS
# pylint: enable=ungrouped-imports

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.



_NOW = datetime.datetime.utcnow # To be replaced by tests.
Expand All @@ -64,10 +66,10 @@
_USER_ROOT = os.path.expanduser('~')
except ImportError: # pragma: NO COVER
_USER_ROOT = None
_GOOGLE_CLOUD_CONFIG_FILE = os.path.join(
_GCLOUD_CONFIG_FILE = os.path.join(
'gcloud', 'configurations', 'config_default')
_GOOGLE_CLOUD_CONFIG_SECTION = 'core'
_GOOGLE_CLOUD_CONFIG_KEY = 'project'
_GCLOUD_CONFIG_SECTION = 'core'
_GCLOUD_CONFIG_KEY = 'project'

This comment was marked as spam.

This comment was marked as spam.



class _LocalStack(Local):
Expand Down Expand Up @@ -202,7 +204,7 @@ def _get_nix_config_path():
:returns: The filename on a *nix system containing the CLI
config file.
"""
return os.path.join(_USER_ROOT, '.config', _GOOGLE_CLOUD_CONFIG_FILE)
return os.path.join(_USER_ROOT, '.config', _GCLOUD_CONFIG_FILE)


def _get_windows_config_path():
Expand All @@ -213,7 +215,7 @@ def _get_windows_config_path():
config file.
"""
appdata_dir = os.getenv('APPDATA', '')
return os.path.join(appdata_dir, _GOOGLE_CLOUD_CONFIG_FILE)
return os.path.join(appdata_dir, _GCLOUD_CONFIG_FILE)


def _default_service_project_id():
Expand Down Expand Up @@ -243,8 +245,8 @@ def _default_service_project_id():
config = configparser.RawConfigParser()
config.read(search_paths)

if config.has_section(_GOOGLE_CLOUD_CONFIG_SECTION):
return config.get(_GOOGLE_CLOUD_CONFIG_SECTION, _GOOGLE_CLOUD_CONFIG_KEY)
if config.has_section(_GCLOUD_CONFIG_SECTION):
return config.get(_GCLOUD_CONFIG_SECTION, _GCLOUD_CONFIG_KEY)


def _compute_engine_id():
Expand Down
5 changes: 3 additions & 2 deletions google/cloud/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

The main concepts with this API are:

- :class:`google.cloud.bigquery.dataset.Dataset` represents an collection of tables.
- :class:`~google.cloud.bigquery.dataset.Dataset` represents a
collection of tables.

- :class:`google.cloud.bigquery.table.Table` represents a single "relation".
- :class:`~google.cloud.bigquery.table.Table` represents a single "relation".
"""

try:
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def list_datasets(self, include_all=False, max_results=None,
datasets.

:rtype: tuple, (list, str)
:returns: list of :class:`google.cloud.bigquery.dataset.Dataset`, plus a
"next page token" string: if the token is not None,
:returns: list of :class:`~google.cloud.bigquery.dataset.Dataset`,
plus a "next page token" string: if the token is not None,
indicates that more datasets can be retrieved with another
call (pass that value as ``page_token``).
"""
Expand Down
21 changes: 14 additions & 7 deletions google/cloud/bigquery/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ def from_api_repr(cls, resource, client):
def _require_client(self, client):
"""Check client or verify over-ride.

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -413,7 +414,8 @@ def create(self, client=None):
See:
https://cloud.google.com/bigquery/docs/reference/v2/tables/insert

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -429,7 +431,8 @@ def exists(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/get

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand All @@ -452,7 +455,8 @@ def reload(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/get

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -468,7 +472,8 @@ def patch(self, client=None, **kw):
See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/patch

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -506,7 +511,8 @@ def update(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/update

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -521,7 +527,8 @@ def delete(self, client=None):
See:
https://cloud.google.com/bigquery/docs/reference/v2/tables/delete

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand Down
15 changes: 10 additions & 5 deletions google/cloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def project(self):
def _require_client(self, client):
"""Check client or verify over-ride.

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -354,7 +355,8 @@ def begin(self, client=None):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -370,7 +372,8 @@ def exists(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/jobs/get

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand All @@ -393,7 +396,8 @@ def reload(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/jobs/get

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -409,7 +413,8 @@ def cancel(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/jobs/cancel

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand Down
9 changes: 6 additions & 3 deletions google/cloud/bigquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def project(self):
def _require_client(self, client):
"""Check client or verify over-ride.

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -301,7 +302,8 @@ def run(self, client=None):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand Down Expand Up @@ -331,7 +333,8 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None,
:param timeout_ms: timeout, in milliseconds, to wait for query to
complete

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down
33 changes: 22 additions & 11 deletions google/cloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ def view_query(self):
def list_partitions(self, client=None):
"""List the partitions in a table.

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -406,7 +407,8 @@ def from_api_repr(cls, resource, dataset):
def _require_client(self, client):
"""Check client or verify over-ride.

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -477,7 +479,8 @@ def create(self, client=None):
See:
https://cloud.google.com/bigquery/docs/reference/v2/tables/insert

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -494,7 +497,8 @@ def exists(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/tables/get

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand All @@ -517,7 +521,8 @@ def reload(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/tables/get

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -540,7 +545,8 @@ def patch(self,
See
https://cloud.google.com/bigquery/docs/reference/v2/tables/patch

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -606,7 +612,8 @@ def update(self, client=None):
See
https://cloud.google.com/bigquery/docs/reference/v2/tables/update

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -621,7 +628,8 @@ def delete(self, client=None):
See:
https://cloud.google.com/bigquery/docs/reference/v2/tables/delete

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.
"""
Expand All @@ -648,7 +656,8 @@ def fetch_data(self, max_results=None, page_token=None, client=None):
:type page_token: str or ``NoneType``
:param page_token: token representing a cursor into the table's rows.

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -714,7 +723,8 @@ def insert_data(self,
schema of the template table. See:
https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables

:type client: :class:`google.cloud.bigquery.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.bigquery.client.Client` or
``NoneType``
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

Expand Down Expand Up @@ -851,7 +861,8 @@ def upload_from_file(self,
:param write_disposition: job configuration option; see
:meth:`google.cloud.bigquery.job.LoadJob`.

:type client: :class:`google.cloud.storage.client.Client` or ``NoneType``
:type client: :class:`~google.cloud.storage.client.Client` or
``NoneType``
:param client: Optional. The client to use. If not passed, falls back
to the ``client`` stored on the current dataset.

Expand Down
8 changes: 4 additions & 4 deletions google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
In the hierarchy of API concepts

* a :class:`Client` owns an :class:`.Instance`
* a :class:`.Instance` owns a :class:`Table <google.cloud.bigtable.table.Table>`
* a :class:`Table <google.cloud.bigtable.table.Table>` owns a
:class:`ColumnFamily <.column_family.ColumnFamily>`
* a :class:`Table <google.cloud.bigtable.table.Table>` owns a :class:`Row <.row.Row>`
* a :class:`.Instance` owns a :class:`~google.cloud.bigtable.table.Table`
* a :class:`~google.cloud.bigtable.table.Table` owns a
:class:`~.column_family.ColumnFamily`
* a :class:`~google.cloud.bigtable.table.Table` owns a :class:`~.row.Row`
(and all the cells in the row)
"""

Expand Down
Loading