diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 58fcbee..0eb02fd 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:c8878270182edaab99f2927969d4f700c3af265accd472c3425deedff2b7fd93 -# created: 2022-07-14T01:58:16.015625351Z + digest: sha256:9db98b055a7f8bd82351238ccaacfd3cda58cdf73012ab58b8da146368330021 +# created: 2022-07-25T16:02:49.174178716Z diff --git a/CHANGELOG.md b/CHANGELOG.md index d54b4dc..43234d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.7.0](https://github.com/googleapis/python-bigquery-connection/compare/v1.6.0...v1.7.0) (2022-08-02) + + +### Features + +* Add service_account_id output field to CloudSQL properties ([#237](https://github.com/googleapis/python-bigquery-connection/issues/237)) ([adc73a6](https://github.com/googleapis/python-bigquery-connection/commit/adc73a6d8ce3f35de56c46a140e940bc63dcd23b)) + + +### Documentation + +* deprecate the AwsCrossAccountRole property ([#240](https://github.com/googleapis/python-bigquery-connection/issues/240)) ([ad17197](https://github.com/googleapis/python-bigquery-connection/commit/ad17197e49d34ef933876d2c1926d2ee4ee206f8)) + ## [1.6.0](https://github.com/googleapis/python-bigquery-connection/compare/v1.5.1...v1.6.0) (2022-07-16) diff --git a/google/cloud/bigquery_connection/__init__.py b/google/cloud/bigquery_connection/__init__.py index 3b48bcc..03a4424 100644 --- a/google/cloud/bigquery_connection/__init__.py +++ b/google/cloud/bigquery_connection/__init__.py @@ -24,6 +24,7 @@ AwsAccessRole, AwsCrossAccountRole, AwsProperties, + AzureProperties, CloudResourceProperties, CloudSpannerProperties, CloudSqlCredential, @@ -43,6 +44,7 @@ "AwsAccessRole", "AwsCrossAccountRole", "AwsProperties", + "AzureProperties", "CloudResourceProperties", "CloudSpannerProperties", "CloudSqlCredential", diff --git a/google/cloud/bigquery_connection_v1/__init__.py b/google/cloud/bigquery_connection_v1/__init__.py index 057bb6d..1893abc 100644 --- a/google/cloud/bigquery_connection_v1/__init__.py +++ b/google/cloud/bigquery_connection_v1/__init__.py @@ -22,6 +22,7 @@ AwsAccessRole, AwsCrossAccountRole, AwsProperties, + AzureProperties, CloudResourceProperties, CloudSpannerProperties, CloudSqlCredential, @@ -40,6 +41,7 @@ "AwsAccessRole", "AwsCrossAccountRole", "AwsProperties", + "AzureProperties", "CloudResourceProperties", "CloudSpannerProperties", "CloudSqlCredential", diff --git a/google/cloud/bigquery_connection_v1/types/__init__.py b/google/cloud/bigquery_connection_v1/types/__init__.py index 4d07f1a..c24bc3e 100644 --- a/google/cloud/bigquery_connection_v1/types/__init__.py +++ b/google/cloud/bigquery_connection_v1/types/__init__.py @@ -17,6 +17,7 @@ AwsAccessRole, AwsCrossAccountRole, AwsProperties, + AzureProperties, CloudResourceProperties, CloudSpannerProperties, CloudSqlCredential, @@ -34,6 +35,7 @@ "AwsAccessRole", "AwsCrossAccountRole", "AwsProperties", + "AzureProperties", "CloudResourceProperties", "CloudSpannerProperties", "CloudSqlCredential", diff --git a/google/cloud/bigquery_connection_v1/types/connection.py b/google/cloud/bigquery_connection_v1/types/connection.py index 3f3a449..34572d7 100644 --- a/google/cloud/bigquery_connection_v1/types/connection.py +++ b/google/cloud/bigquery_connection_v1/types/connection.py @@ -32,6 +32,7 @@ "AwsProperties", "AwsCrossAccountRole", "AwsAccessRole", + "AzureProperties", "CloudResourceProperties", }, ) @@ -211,6 +212,10 @@ class Connection(proto.Message): aws (google.cloud.bigquery_connection_v1.types.AwsProperties): Amazon Web Services (AWS) properties. + This field is a member of `oneof`_ ``properties``. + azure (google.cloud.bigquery_connection_v1.types.AzureProperties): + Azure properties. + This field is a member of `oneof`_ ``properties``. cloud_spanner (google.cloud.bigquery_connection_v1.types.CloudSpannerProperties): Cloud Spanner properties. @@ -255,6 +260,12 @@ class Connection(proto.Message): oneof="properties", message="AwsProperties", ) + azure = proto.Field( + proto.MESSAGE, + number=11, + oneof="properties", + message="AzureProperties", + ) cloud_spanner = proto.Field( proto.MESSAGE, number=21, @@ -294,6 +305,14 @@ class CloudSqlProperties(proto.Message): Type of the Cloud SQL database. credential (google.cloud.bigquery_connection_v1.types.CloudSqlCredential): Input only. Cloud SQL credential. + service_account_id (str): + Output only. The account ID of the service + used for the purpose of this connection. + When the connection is used in the context of an + operation in BigQuery, this service account will + serve as identity being used for connecting to + the CloudSQL instance specified in this + connection. """ class DatabaseType(proto.Enum): @@ -320,6 +339,10 @@ class DatabaseType(proto.Enum): number=4, message="CloudSqlCredential", ) + service_account_id = proto.Field( + proto.STRING, + number=5, + ) class CloudSqlCredential(proto.Message): @@ -378,7 +401,7 @@ class AwsProperties(proto.Message): cross_account_role (google.cloud.bigquery_connection_v1.types.AwsCrossAccountRole): Authentication using Google owned AWS IAM user's access key to assume into customer's AWS - IAM Role. + IAM Role. Deprecated, do not use. This field is a member of `oneof`_ ``authentication_method``. access_role (google.cloud.bigquery_connection_v1.types.AwsAccessRole): @@ -460,6 +483,66 @@ class AwsAccessRole(proto.Message): ) +class AzureProperties(proto.Message): + r"""Container for connection properties specific to Azure. + + Attributes: + application (str): + Output only. The name of the Azure Active + Directory Application. + client_id (str): + Output only. The client id of the Azure + Active Directory Application. + object_id (str): + Output only. The object id of the Azure + Active Directory Application. + customer_tenant_id (str): + The id of customer's directory that host the + data. + redirect_uri (str): + The URL user will be redirected to after + granting consent during connection setup. + federated_application_client_id (str): + The client id of the user's Azure Active + Directory Application used for a federated + connection. + identity (str): + Output only. A unique Google-owned and + Google-generated identity for the Connection. + This identity will be used to access the user's + Azure Active Directory Application. + """ + + application = proto.Field( + proto.STRING, + number=1, + ) + client_id = proto.Field( + proto.STRING, + number=2, + ) + object_id = proto.Field( + proto.STRING, + number=3, + ) + customer_tenant_id = proto.Field( + proto.STRING, + number=4, + ) + redirect_uri = proto.Field( + proto.STRING, + number=5, + ) + federated_application_client_id = proto.Field( + proto.STRING, + number=6, + ) + identity = proto.Field( + proto.STRING, + number=7, + ) + + class CloudResourceProperties(proto.Message): r"""Container for connection properties for delegation of access to GCP resources. diff --git a/noxfile.py b/noxfile.py index 94b2f9c..cc39f3b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -334,7 +334,8 @@ def prerelease_deps(session): # Install all dependencies session.install("-e", ".[all, tests, tracing]") - session.install(*UNIT_TEST_STANDARD_DEPENDENCIES) + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + session.install(*unit_deps_all) system_deps_all = ( SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES @@ -363,12 +364,6 @@ def prerelease_deps(session): session.install(*constraints_deps) - if os.path.exists("samples/snippets/requirements.txt"): - session.install("-r", "samples/snippets/requirements.txt") - - if os.path.exists("samples/snippets/requirements-test.txt"): - session.install("-r", "samples/snippets/requirements-test.txt") - prerel_deps = [ "protobuf", # dependency of grpc @@ -405,11 +400,19 @@ def prerelease_deps(session): system_test_folder_path = os.path.join("tests", "system") # Only run system tests if found. - if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path): - session.run("py.test", "tests/system") - - snippets_test_path = os.path.join("samples", "snippets") - - # Only run samples tests if found. - if os.path.exists(snippets_test_path): - session.run("py.test", "samples/snippets") + if os.path.exists(system_test_path): + session.run( + "py.test", + "--verbose", + f"--junitxml=system_{session.python}_sponge_log.xml", + system_test_path, + *session.posargs, + ) + if os.path.exists(system_test_folder_path): + session.run( + "py.test", + "--verbose", + f"--junitxml=system_{session.python}_sponge_log.xml", + system_test_folder_path, + *session.posargs, + ) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 0719c92..18f53ca 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,2 +1,2 @@ pytest==7.1.2 -google-cloud-testutils==1.3.2 \ No newline at end of file +google-cloud-testutils==1.3.3 \ No newline at end of file diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index a001cd8..7e4e7ce 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-bigquery-connection==1.5.0 \ No newline at end of file +google-cloud-bigquery-connection==1.6.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 4bdde39..97e3162 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import setuptools # type: ignore -version = "1.6.0" +version = "1.7.0" package_root = os.path.abspath(os.path.dirname(__file__))