diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7e..a9fcd07c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ae570eb0..1473ae01 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,4 +8,4 @@ * @googleapis/api-bigquery @googleapis/yoshi-python # The python-samples-reviewers team is the default owner for samples changes -/samples/ @googleapis/python-samples-owners +/samples/ @googleapis/python-samples-owners @googleapis/api-bigquery @googleapis/yoshi-python diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index af599353..3e98ae70 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,9 +1,11 @@ -# https://github.com/googleapis/repo-automation-bots/tree/master/packages/sync-repo-settings -# Rules for master branch protection +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings +# Rules for main branch protection branchProtectionRules: # Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master +# Defaults to `main` +- pattern: main + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: true requiredStatusCheckContexts: - 'Kokoro' - 'cla/google' diff --git a/.kokoro/build.sh b/.kokoro/build.sh index d45fa521..08a86db8 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d54..8a324c9c 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/CHANGELOG.md b/CHANGELOG.md index 12773f6b..0e37b900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-bigquery-datatransfer/#history +### [3.3.2](https://www.github.com/googleapis/python-bigquery-datatransfer/compare/v3.3.1...v3.3.2) (2021-08-27) + + +### Documentation + +* Improvements to various message and field descriptions ([#202](https://www.github.com/googleapis/python-bigquery-datatransfer/issues/202)) ([9684723](https://www.github.com/googleapis/python-bigquery-datatransfer/commit/9684723aed8c743d665ccac2b338770dd09fc94a)) + ### [3.3.1](https://www.github.com/googleapis/python-bigquery-datatransfer/compare/v3.3.0...v3.3.1) (2021-07-26) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 26ea1fac..1498226b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-bigquery-datatransfer # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-bigquery-datatransfer.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date version of ``python-bigquery-datatransfer``. The the suggested remote name ``upstream`` should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + the branch should be the main branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-bigquery-datatransfer/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-bigquery-datatransfer/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-bigquery-datatransfer @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-bigquery-datatransfer/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-bigquery-datatransfer/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/UPGRADING.md b/UPGRADING.md index b9e04ba1..caeb7d42 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -150,7 +150,7 @@ positional parameter `request`. Method docstrings indicate whether a parameter i required or optional. Some methods have additional keyword only parameters. The available parameters depend -on the [`google.api.method_signature` annotation](https://github.com/googleapis/python-bigquery-datatransfer/blob/master/google/cloud/bigquery_datatransfer_v1/proto/datatransfer.proto#L80) +on the [`google.api.method_signature` annotation](https://github.com/googleapis/python-bigquery-datatransfer/blob/main/google/cloud/bigquery_datatransfer_v1/proto/datatransfer.proto#L80) specified by the API producer. diff --git a/docs/conf.py b/docs/conf.py index 96f393bf..d55d2469 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,8 +76,8 @@ # The encoding of source files. # source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # General information about the project. project = "google-cloud-bigquery-datatransfer" @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", @@ -279,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-bigquery-datatransfer.tex", "google-cloud-bigquery-datatransfer Documentation", author, @@ -314,7 +315,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ( - master_doc, + root_doc, "google-cloud-bigquery-datatransfer", "google-cloud-bigquery-datatransfer Documentation", [author], @@ -333,7 +334,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-bigquery-datatransfer", "google-cloud-bigquery-datatransfer Documentation", author, diff --git a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py index 7f502338..fc73542b 100644 --- a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py +++ b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/async_client.py @@ -724,8 +724,8 @@ async def list_transfer_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransferConfigsAsyncPager: - r"""Returns information about all data transfers in the - project. + r"""Returns information about all transfer configs owned + by a project in the specified location. Args: request (:class:`google.cloud.bigquery_datatransfer_v1.types.ListTransferConfigsRequest`): diff --git a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py index 637b0cdf..e735a19d 100644 --- a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py +++ b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/client.py @@ -897,8 +897,8 @@ def list_transfer_configs( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransferConfigsPager: - r"""Returns information about all data transfers in the - project. + r"""Returns information about all transfer configs owned + by a project in the specified location. Args: request (google.cloud.bigquery_datatransfer_v1.types.ListTransferConfigsRequest): diff --git a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py index 6f431d2a..b0041dff 100644 --- a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py +++ b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc.py @@ -401,8 +401,8 @@ def list_transfer_configs( ]: r"""Return a callable for the list transfer configs method over gRPC. - Returns information about all data transfers in the - project. + Returns information about all transfer configs owned + by a project in the specified location. Returns: Callable[[~.ListTransferConfigsRequest], diff --git a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py index a5f7d8f4..b7c0d612 100644 --- a/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py +++ b/google/cloud/bigquery_datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py @@ -415,8 +415,8 @@ def list_transfer_configs( ]: r"""Return a callable for the list transfer configs method over gRPC. - Returns information about all data transfers in the - project. + Returns information about all transfer configs owned + by a project in the specified location. Returns: Callable[[~.ListTransferConfigsRequest], diff --git a/google/cloud/bigquery_datatransfer_v1/types/datatransfer.py b/google/cloud/bigquery_datatransfer_v1/types/datatransfer.py index d9869c0d..0e043788 100644 --- a/google/cloud/bigquery_datatransfer_v1/types/datatransfer.py +++ b/google/cloud/bigquery_datatransfer_v1/types/datatransfer.py @@ -731,13 +731,14 @@ class TimeRange(proto.Message): Start time of the range of transfer runs. For example, ``"2017-05-25T00:00:00+00:00"``. The start_time must be strictly less than the end_time. Creates transfer runs where - run_time is in the range betwen start_time (inclusive) and - end_time (exlusive). + run_time is in the range between start_time (inclusive) and + end_time (exclusive). end_time (google.protobuf.timestamp_pb2.Timestamp): End time of the range of transfer runs. For example, ``"2017-05-30T00:00:00+00:00"``. The end_time must not be in the future. Creates transfer runs where run_time is in the - range betwen start_time (inclusive) and end_time (exlusive). + range between start_time (inclusive) and end_time + (exclusive). """ start_time = proto.Field( diff --git a/google/cloud/bigquery_datatransfer_v1/types/transfer.py b/google/cloud/bigquery_datatransfer_v1/types/transfer.py index 5e04fc7d..76a5856f 100644 --- a/google/cloud/bigquery_datatransfer_v1/types/transfer.py +++ b/google/cloud/bigquery_datatransfer_v1/types/transfer.py @@ -108,13 +108,11 @@ class TransferConfig(proto.Message): Attributes: name (str): The resource name of the transfer config. Transfer config - names have the form of + names have the form ``projects/{project_id}/locations/{region}/transferConfigs/{config_id}``. - The name is automatically generated based on the config_id - specified in CreateTransferConfigRequest along with - project_id and region. If config_id is not provided, usually - a uuid, even though it is not guaranteed or required, will - be generated for config_id. + Where ``config_id`` is usually a uuid, even though it is not + guaranteed or required. The name is ignored when creating a + transfer config. destination_dataset_id (str): The BigQuery target dataset id. display_name (str): @@ -124,7 +122,13 @@ class TransferConfig(proto.Message): Data source id. Cannot be changed once data transfer is created. params (google.protobuf.struct_pb2.Struct): - Data transfer specific parameters. + Parameters specific to each data source. For + more information see the bq tab in the 'Setting + up a data transfer' section for each data + source. For example the parameters for Cloud + Storage transfers are listed here: + https://cloud.google.com/bigquery- + transfer/docs/cloud-storage-transfer#bq schedule (str): Data transfer schedule. If the data source does not support a custom schedule, this should be empty. If it is empty, the @@ -166,9 +170,11 @@ class TransferConfig(proto.Message): Output only. Region in which BigQuery dataset is located. notification_pubsub_topic (str): - Pub/Sub topic where notifications will be - sent after transfer runs associated with this - transfer config finish. + Pub/Sub topic where notifications will be sent after + transfer runs associated with this transfer config finish. + + The format for specifying a pubsub topic is: + ``projects/{project}/topics/{topic}`` email_preferences (google.cloud.bigquery_datatransfer_v1.types.EmailPreferences): Email notifications will be sent according to these preferences to the email address of the @@ -224,8 +230,13 @@ class TransferRun(proto.Message): Output only. Last time the data transfer run state was updated. params (google.protobuf.struct_pb2.Struct): - Output only. Data transfer specific - parameters. + Output only. Parameters specific to each data + source. For more information see the bq tab in + the 'Setting up a data transfer' section for + each data source. For example the parameters for + Cloud Storage transfers are listed here: + https://cloud.google.com/bigquery- + transfer/docs/cloud-storage-transfer#bq destination_dataset_id (str): Output only. The BigQuery target dataset id. data_source_id (str): @@ -244,9 +255,11 @@ class TransferRun(proto.Message): depending on the current load, so ``schedule_time`` doesn't always match this. notification_pubsub_topic (str): - Output only. Pub/Sub topic where a - notification will be sent after this transfer - run finishes + Output only. Pub/Sub topic where a notification will be sent + after this transfer run finishes. + + The format for specifying a pubsub topic is: + ``projects/{project}/topics/{topic}`` email_preferences (google.cloud.bigquery_datatransfer_v1.types.EmailPreferences): Output only. Email notifications will be sent according to these preferences to the email diff --git a/noxfile.py b/noxfile.py index 94ee6a8f..93ea9b14 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/owlbot.py b/owlbot.py index 08dd3376..8e813ea1 100644 --- a/owlbot.py +++ b/owlbot.py @@ -56,6 +56,63 @@ python.py_samples(skip_readmes=True) +# Remove the replacements below once +# https://github.com/googleapis/synthtool/pull/1188 is merged + +# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files +s.replace( + ".kokoro/*.sh", "repo-automation-bots/tree/master", "repo-automation-bots/tree/main" +) + +# Customize CONTRIBUTING.rst to replace master with main +s.replace( + "CONTRIBUTING.rst", + "fetch and merge changes from upstream into master", + "fetch and merge changes from upstream into main", +) + +s.replace( + "CONTRIBUTING.rst", + "git merge upstream/master", + "git merge upstream/main", +) + +s.replace( + "CONTRIBUTING.rst", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""", + """export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""", +) + +s.replace( + "CONTRIBUTING.rst", + "remote \(``master``\)", + "remote (``main``)", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/CONTRIBUTING.rst", + "blob/main/CONTRIBUTING.rst", +) + +s.replace( + "CONTRIBUTING.rst", + "blob/master/noxfile.py", + "blob/main/noxfile.py", +) + +s.replace( + "docs/conf.py", + "master_doc", + "root_doc", +) + +s.replace( + "docs/conf.py", + "# The master toctree document.", + "# The root toctree document.", +) + s.shell.run(["nox", "-s", "blacken"], hide_output=False) for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"): s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False) diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 9fc7f178..b008613f 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7"], + "ignored_versions": [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, @@ -86,15 +86,18 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) # # Style Checks # diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 1f919865..64a590b8 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,4 +1,4 @@ -google-cloud-bigquery==2.22.1 -google-cloud-pubsub==2.6.1 +google-cloud-bigquery==2.25.1 +google-cloud-pubsub==2.7.1 pytest==6.2.4 mock==4.0.3 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index c1d4d391..4266eefc 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-bigquery-datatransfer==3.3.0 +google-cloud-bigquery-datatransfer==3.3.1 diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406dba..275d6498 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash diff --git a/setup.py b/setup.py index d75c0a36..273688ce 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-bigquery-datatransfer" description = "BigQuery Data Transfer API client library" -version = "3.3.1" +version = "3.3.2" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' @@ -35,6 +35,7 @@ "google-api-core[grpc] >= 1.26.0, <3.0.0dev", "proto-plus >= 1.15.0", "packaging >= 14.3", + "pytz >= 2021.1", ) extras = {"libcst": "libcst >= 0.2.5"}