Skip to content

Commit

Permalink
chore(deps): update dependency google-cloud-bigquery to v3.11.4 (#10526)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency google-cloud-bigquery to v3.11.4

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add retry

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Leah Cole <coleleah@google.com>
  • Loading branch information
3 people authored Aug 17, 2023
1 parent a11062c commit 2d68c3c
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 61 deletions.
4 changes: 4 additions & 0 deletions asset/snippets/quickstart_batchgeteffectiveiampolicy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@

import os

from google.api_core import retry
from google.api_core.exceptions import DeadlineExceeded

import quickstart_batchgeteffectiveiampolicy

PROJECT = os.environ["GOOGLE_CLOUD_PROJECT"]


@retry.Retry(retry.if_exception_type(DeadlineExceeded))
def test_batch_get_effective_iam_policies(capsys):
scope = f"projects/{PROJECT}"
resource_names = [f"//cloudresourcemanager.googleapis.com/projects/{PROJECT}"]
Expand Down
2 changes: 1 addition & 1 deletion asset/snippets/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ google-cloud-storage==2.9.0
google-cloud-asset==3.19.0
google-cloud-resource-manager==1.10.1
google-cloud-pubsub==2.17.0
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
2 changes: 1 addition & 1 deletion bigquery-datatransfer/snippets/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-bigquery==3.11.1
google-cloud-bigquery==3.11.4
google-cloud-pubsub==2.17.1
pytest==7.3.2
mock==5.0.2
2 changes: 1 addition & 1 deletion bigquery/bqml/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-bigquery[pandas,bqstorage]==3.11.0
google-cloud-bigquery[pandas,bqstorage]==3.11.4
google-cloud-bigquery-storage==2.19.1
pandas==1.3.5; python_version == '3.7'
pandas==2.0.1; python_version > '3.7'
Expand Down
2 changes: 1 addition & 1 deletion bigquery/datalab-migration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
grpcio==1.56.0
google-cloud-bigquery[pandas,pyarrow]==3.11.0
google-cloud-bigquery[pandas,pyarrow]==3.11.4
# datalab has outdated dependencies that require google-api-core < 2
# The last version of google-cloud-bigquery-storage that supports google-api-core 1.x is 2.13.2
google-cloud-bigquery-storage==2.19.1
Expand Down
2 changes: 1 addition & 1 deletion bigquery/pandas-gbq-migration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
google-cloud-bigquery-storage==2.19.1
pandas==1.1.5; python_version < '3.7'
pandas==1.3.5; python_version == '3.7'
Expand Down
2 changes: 1 addition & 1 deletion contact-center-insights/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google-api-core==2.11.1
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
google-cloud-contact-center-insights==1.11.0
2 changes: 1 addition & 1 deletion datacatalog/quickstart/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==7.2.0
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
2 changes: 1 addition & 1 deletion dataflow/extensible-templates/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
google-api-python-client==2.87.0
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
google-cloud-storage==2.9.0
pytest-xdist==3.3.0
pytest==7.0.1
Expand Down
6 changes: 2 additions & 4 deletions dlp/snippets/deid.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def reidentify_text_with_fpe(
"crypto_key": {
"kms_wrapped": {"wrapped_key": wrapped_key, "crypto_key_name": key_name}
},
"common_alphabet": 'NUMERIC',
"common_alphabet": "NUMERIC",
"surrogate_info_type": surrogate_info_type,
}

Expand All @@ -376,9 +376,7 @@ def reidentify_text_with_fpe(

# Construct inspect configuration dictionary
inspect_config = {
"custom_info_types": [
{"info_type": surrogate_info_type, "surrogate_type": {}}
]
"custom_info_types": [{"info_type": surrogate_info_type, "surrogate_type": {}}]
}

# Construct the `item`.
Expand Down
54 changes: 34 additions & 20 deletions dlp/snippets/deid_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def deidentify_table_bucketing(
def deidentify_table_primitive_bucketing(
project: str,
) -> None:
""" Uses the Data Loss Prevention API to de-identify sensitive data in
"""Uses the Data Loss Prevention API to de-identify sensitive data in
a table by replacing them with generalized bucket labels.
Args:
project: The Google Cloud project id to use as a parent resource.
Expand Down Expand Up @@ -547,9 +547,21 @@ def deidentify_table_primitive_bucketing(

# Construct generalised bucket configuration.
buckets_config = [
{"min_": {"integer_value": 0}, "max_": {"integer_value": 25}, "replacement_value": {"string_value": "Low"}},
{"min_": {"integer_value": 25}, "max_": {"integer_value": 75}, "replacement_value": {"string_value": "Medium"}},
{"min_": {"integer_value": 75}, "max_": {"integer_value": 100}, "replacement_value": {"string_value": "High"}},
{
"min_": {"integer_value": 0},
"max_": {"integer_value": 25},
"replacement_value": {"string_value": "Low"},
},
{
"min_": {"integer_value": 25},
"max_": {"integer_value": 75},
"replacement_value": {"string_value": "Medium"},
},
{
"min_": {"integer_value": 75},
"max_": {"integer_value": 100},
"replacement_value": {"string_value": "High"},
},
]

# Construct de-identify configuration that groups values in a table field and replace those with bucket labels.
Expand All @@ -560,18 +572,20 @@ def deidentify_table_primitive_bucketing(
"fields": [{"name": "happiness_score"}],
"primitive_transformation": {
"bucketing_config": {"buckets": buckets_config}
}
},
}
]
}
}

# Call the API to deidentify table data through primitive bucketing.
response = dlp.deidentify_content(request={
"parent": parent,
"deidentify_config": deidentify_config,
"item": item,
})
response = dlp.deidentify_content(
request={
"parent": parent,
"deidentify_config": deidentify_config,
"item": item,
}
)

# Print the results.
print("Table after de-identification: {}".format(response.item.table))
Expand Down Expand Up @@ -1097,7 +1111,7 @@ def deidentify_table_suppress_row(
crypto_hash_parser = subparsers.add_parser(
"deid_table_crypto_hash",
help="De-identify sensitive data in a table using a cryptographic "
"hash transformation.",
"hash transformation.",
)
crypto_hash_parser.add_argument(
"project",
Expand All @@ -1111,8 +1125,8 @@ def deidentify_table_suppress_row(
"--info_types",
action="append",
help="Strings representing infoTypes to look for. A full list of "
"info categories and types is available from the API. Examples "
'include "FIRST_NAME", "LAST_NAME", "EMAIL_ADDRESS". ',
"info categories and types is available from the API. Examples "
'include "FIRST_NAME", "LAST_NAME", "EMAIL_ADDRESS". ',
)
crypto_hash_parser.add_argument(
"transient_key_name",
Expand All @@ -1122,7 +1136,7 @@ def deidentify_table_suppress_row(
multiple_crypto_hash_parser = subparsers.add_parser(
"deid_table_multiple_crypto_hash",
help="De-identify sensitive data in a table using multiple transient "
"cryptographic hash keys.",
"cryptographic hash keys.",
)
multiple_crypto_hash_parser.add_argument(
"project",
Expand All @@ -1136,8 +1150,8 @@ def deidentify_table_suppress_row(
"--info_types",
action="append",
help="Strings representing infoTypes to look for. A full list of "
"info categories and types is available from the API. Examples "
'include "FIRST_NAME", "LAST_NAME", "EMAIL_ADDRESS". ',
"info categories and types is available from the API. Examples "
'include "FIRST_NAME", "LAST_NAME", "EMAIL_ADDRESS". ',
)
multiple_crypto_hash_parser.add_argument(
"transient_key_name_1",
Expand Down Expand Up @@ -1299,7 +1313,7 @@ def deidentify_table_suppress_row(
table_row_suppress_parser = subparsers.add_parser(
"deid_table_row_suppress",
help="De-identify sensitive data in a table by suppressing "
"entire row/s based on a condition.",
"entire row/s based on a condition.",
)
table_row_suppress_parser.add_argument(
"project",
Expand All @@ -1316,9 +1330,9 @@ def deidentify_table_suppress_row(
table_row_suppress_parser.add_argument(
"--condition_operator",
help="Operator used to compare the field or infoType to the value. "
"One of: RELATIONAL_OPERATOR_UNSPECIFIED, EQUAL_TO, NOT_EQUAL_TO, "
"GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUALS, LESS_THAN_OR_EQUALS, "
"EXISTS.",
"One of: RELATIONAL_OPERATOR_UNSPECIFIED, EQUAL_TO, NOT_EQUAL_TO, "
"GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUALS, LESS_THAN_OR_EQUALS, "
"EXISTS.",
)
table_row_suppress_parser.add_argument(
"--condition_value",
Expand Down
5 changes: 2 additions & 3 deletions dlp/snippets/deid_table_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,13 @@ def test_deidentify_table_bucketing(capsys: pytest.CaptureFixture) -> None:


def test_deidentify_table_primitive_bucketing(capsys: pytest.CaptureFixture) -> None:

deid_table.deidentify_table_primitive_bucketing(
GCLOUD_PROJECT,
)

out, _ = capsys.readouterr()
assert "string_value: \"High\"" in out
assert "string_value: \"Low\"" in out
assert 'string_value: "High"' in out
assert 'string_value: "Low"' in out


def test_deidentify_table_condition_replace_with_info_types(
Expand Down
1 change: 0 additions & 1 deletion dlp/snippets/deid_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def test_deidentify_with_fpe_ignores_insensitive_data(


def test_reidentify_text_with_fpe(capsys: pytest.CaptureFixture) -> None:

labeled_fpe_string = "My phone number is PHONE_NUMBER(10):9617256398"

deid.reidentify_text_with_fpe(
Expand Down
26 changes: 9 additions & 17 deletions dlp/snippets/inspect_content_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,13 @@ def test_inspect_gcs_file(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
1,
)
Expand Down Expand Up @@ -487,14 +486,13 @@ def test_inspect_gcs_file_with_custom_info_types(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
1,
)
Expand Down Expand Up @@ -531,14 +529,13 @@ def test_inspect_gcs_file_no_results(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
)

inspect_content.inspect_gcs_file(
Expand Down Expand Up @@ -567,14 +564,13 @@ def test_inspect_gcs_image_file(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
1,
)
Expand Down Expand Up @@ -604,14 +600,13 @@ def test_inspect_gcs_multiple_files(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
random.randint(0, 1000),
)
Expand Down Expand Up @@ -642,14 +637,13 @@ def test_inspect_gcs_with_sampling(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
random.randint(0, 1000),
)
Expand Down Expand Up @@ -686,7 +680,7 @@ def test_inspect_datastore(
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
random.randint(0, 1000),
)
Expand Down Expand Up @@ -746,14 +740,13 @@ def test_inspect_bigquery(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"EMAIL_ADDRESS",
random.randint(0, 1000),
)
Expand Down Expand Up @@ -786,14 +779,13 @@ def test_inspect_bigquery_with_sampling(
dlp_client: MagicMock,
capsys: pytest.CaptureFixture,
) -> None:

# Mock DLP client and subscriber client along with their behavior
mock_dlp_instance = dlp_client.return_value
mock_subscriber_instance = subscriber_client.return_value
mock_job_and_subscriber(
mock_dlp_instance,
mock_subscriber_instance,
f'projects/{GCLOUD_PROJECT}/dlpJobs/test_job',
f"projects/{GCLOUD_PROJECT}/dlpJobs/test_job",
"PERSON_NAME",
random.randint(0, 1000),
)
Expand Down
2 changes: 1 addition & 1 deletion dlp/snippets/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ google-cloud-dlp==3.12.1
google-cloud-storage==2.9.0
google-cloud-pubsub==2.17.0
google-cloud-datastore==2.15.2
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
2 changes: 1 addition & 1 deletion functions/v2/response_streaming/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==2.2.2
functions-framework==3.3.0
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
pytest==7.2.1
2 changes: 1 addition & 1 deletion notebooks/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google-cloud-storage==2.9.0
google-cloud-bigquery[pandas,pyarrow]==3.11.0
google-cloud-bigquery[pandas,pyarrow]==3.11.4
matplotlib==3.7.1
2 changes: 1 addition & 1 deletion people-and-planet-ai/image-classification/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pillow==9.5.0; python_version < '3.8'
pillow==10.0.0; python_version >= '3.8'
apache-beam[gcp]==2.46.0
google-cloud-aiplatform==1.25.0
google-cloud-bigquery==3.11.0 # Indirect dependency, but there is a version conflict that causes pip to hang unless we constraint this.
google-cloud-bigquery==3.11.4 # Indirect dependency, but there is a version conflict that causes pip to hang unless we constraint this.
2 changes: 1 addition & 1 deletion retail/interactive-tutorials/events/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google==3.0.0
google-cloud-retail==1.16.1
google-cloud-storage==2.9.0
google-cloud-bigquery==3.11.0
google-cloud-bigquery==3.11.4
Loading

0 comments on commit 2d68c3c

Please sign in to comment.