Skip to content

Commit

Permalink
Merge branch 'main' into python-speech-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
telpirion authored Feb 1, 2023
2 parents 7f9064c + 78c86ec commit eaf47b8
Show file tree
Hide file tree
Showing 31 changed files with 456 additions and 51 deletions.
7 changes: 4 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@
/kubernetes_engine/**/* @GoogleCloudPlatform/python-samples-reviewers
/kubernetes_engine/django_tutorial/**/* @glasnt @GoogleCloudPlatform/python-samples-reviewers
/language/**/* @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/python-samples-reviewers
/logging/**/* @GoogleCloudPlatform/dee-observability @GoogleCloudPlatform/python-samples-reviewers
/media_cdn/**/* @justin-mp @msampathkumar @GoogleCloudPlatform/python-samples-reviewers
/memorystore/**/* @GoogleCloudPlatform/python-samples-reviewers
/ml_engine/**/* @ivanmkc @GoogleCloudPlatform/python-samples-reviewers
/monitoring/**/* @GoogleCloudPlatform/dee-observability @GoogleCloudPlatform/python-samples-reviewers
/monitoring/opencensus @yuriatgoogle @GoogleCloudPlatform/python-samples-reviewers
/monitoring/prometheus @yuriatgoogle @GoogleCloudPlatform/python-samples-reviewers
/monitoring/opencensus @yuriatgoogle @GoogleCloudPlatform/dee-observability @GoogleCloudPlatform/python-samples-reviewers
/monitoring/prometheus @yuriatgoogle @GoogleCloudPlatform/dee-observability @GoogleCloudPlatform/python-samples-reviewers
/notebooks/**/* @alixhami @GoogleCloudPlatform/python-samples-reviewers
/optimization/**/* @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/python-samples-reviewers
/opencensus/**/* @GoogleCloudPlatform/python-samples-reviewers
Expand All @@ -83,7 +84,7 @@
/storage/**/* @GoogleCloudPlatform/cloud-storage-dpes @GoogleCloudPlatform/python-samples-reviewers
/storagetransfer/**/* @GoogleCloudPlatform/cloud-storage-dpes @GoogleCloudPlatform/python-samples-reviewers
/texttospeech/**/* @GoogleCloudPlatform/dee-data-ai @GoogleCloudPlatform/python-samples-reviewers
/trace/**/* @ymotongpoo @GoogleCloudPlatform/python-samples-reviewers
/trace/**/* @ymotongpoo @GoogleCloudPlatform/dee-observability @GoogleCloudPlatform/python-samples-reviewers
/translate/**/* @nicain @GoogleCloudPlatform/python-samples-reviewers
/talent/**/* @GoogleCloudPlatform/python-samples-reviewers
/vision/**/* @GoogleCloudPlatform/python-samples-reviewers
Expand Down
2 changes: 2 additions & 0 deletions .github/blunderbuss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ assign_issues_by:
- GoogleCloudPlatform/python-samples-reviewers
- ivanmkc
- labels:
- 'api: logging'
- 'api: monitoring'
- 'api: trace'
to:
- GoogleCloudPlatform/dee-observability
- labels:
Expand Down
31 changes: 18 additions & 13 deletions appengine/standard_python3/bundled-services/mail/wsgi/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,24 @@ def test_send_receive(version):
assert "Successfully sent mail" in response.text
assert response.status_code == 201

# Give the mail some time to be delivered and logs to post
time.sleep(60)

# Fetch logs to check messages on received mail
entries = gcloud_cli(
f'logging read "resource.type=gae_app AND resource.labels.version_id={version_id}"'
)

text_payloads = ""
for entry in entries:
if "textPayload" in entry:
text_payloads += entry["textPayload"]
text_payloads += "\n"
# External mail delivery and receipt can take varying lengths of time
for check in range(3):
# Give the mail some time to be delivered and logs to post
time.sleep(60)

# Fetch logs to check messages on received mail
entries = gcloud_cli(
f'logging read "resource.type=gae_app AND resource.labels.version_id={version_id}"'
)

text_payloads = ""
for entry in entries:
if "textPayload" in entry:
text_payloads += entry["textPayload"]
text_payloads += "\n"

if "Received" in text_payloads:
break

expected = f"Received greeting for valid-user@{version_id}-dot-{project_id}.appspotmail.com"
assert expected in text_payloads
Expand Down
2 changes: 1 addition & 1 deletion asset/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
google-cloud-storage==2.6.0
google-cloud-asset==3.14.2
google-cloud-asset==3.17.1
google-cloud-resource-manager==1.6.3
google-cloud-pubsub==2.13.11
google-cloud-bigquery==3.4.0
4 changes: 2 additions & 2 deletions auth/api-client/authenticate_with_api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_authenticate_api_key]
# [START apikeys_authenticate_api_key]

from google.cloud import language_v1

Expand Down Expand Up @@ -46,4 +46,4 @@ def authenticate_with_api_key(quota_project_id: str, api_key_string: str) -> Non
print(f"Sentiment: {sentiment.score}, {sentiment.magnitude}")
print("Successfully authenticated using the API key")

# [END auth_cloud_authenticate_api_key]
# [END apikeys_authenticate_api_key]
4 changes: 2 additions & 2 deletions auth/api-client/create_api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_create_api_key]
# [START apikeys_create_api_key]

from google.cloud import api_keys_v2
from google.cloud.api_keys_v2 import Key
Expand Down Expand Up @@ -53,4 +53,4 @@ def create_api_key(project_id: str) -> Key:
# To restrict the usage of this API key, use the value in "response.name".
return response

# [END auth_cloud_create_api_key]
# [END apikeys_create_api_key]
4 changes: 2 additions & 2 deletions auth/api-client/delete_api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_delete_api_key]
# [START apikeys_delete_api_key]

from google.cloud import api_keys_v2

Expand Down Expand Up @@ -42,4 +42,4 @@ def delete_api_key(project_id: str, key_id: str) -> None:
result = client.delete_key(delete_key_request).result()
print(f"Successfully deleted the API key: {result.name}")

# [END auth_cloud_delete_api_key]
# [END apikeys_delete_api_key]
4 changes: 2 additions & 2 deletions auth/api-client/lookup_api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_lookup_api_key]
# [START apikeys_lookup_api_key]

from google.cloud import api_keys_v2

Expand Down Expand Up @@ -45,4 +45,4 @@ def lookup_api_key(api_key_string: str) -> None:

print(f"Successfully retrieved the API key name: {lookup_key_response.name}")

# [END auth_cloud_lookup_api_key]
# [END apikeys_lookup_api_key]
4 changes: 2 additions & 2 deletions auth/api-client/restrict_api_key_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_restrict_api_key_android]
# [START apikeys_restrict_api_key_android]

from google.cloud import api_keys_v2
from google.cloud.api_keys_v2 import Key
Expand Down Expand Up @@ -70,4 +70,4 @@ def restrict_api_key_android(project_id: str, key_id: str) -> Key:
# Use response.key_string to authenticate.
return response

# [END auth_cloud_restrict_api_key_android]
# [END apikeys_restrict_api_key_android]
4 changes: 2 additions & 2 deletions auth/api-client/restrict_api_key_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_restrict_api_key_api]
# [START apikeys_restrict_api_key_api]

from google.cloud import api_keys_v2
from google.cloud.api_keys_v2 import Key
Expand Down Expand Up @@ -65,4 +65,4 @@ def restrict_api_key_api(project_id: str, key_id: str) -> Key:
# Use response.key_string to authenticate.
return response

# [END auth_cloud_restrict_api_key_api]
# [END apikeys_restrict_api_key_api]
4 changes: 2 additions & 2 deletions auth/api-client/restrict_api_key_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_restrict_api_key_http]
# [START apikeys_restrict_api_key_http]

from google.cloud import api_keys_v2
from google.cloud.api_keys_v2 import Key
Expand Down Expand Up @@ -64,4 +64,4 @@ def restrict_api_key_http(project_id: str, key_id: str) -> Key:
# Use response.key_string to authenticate.
return response

# [END auth_cloud_restrict_api_key_http]
# [END apikeys_restrict_api_key_http]
4 changes: 2 additions & 2 deletions auth/api-client/restrict_api_key_ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_restrict_api_key_ios]
# [START apikeys_restrict_api_key_ios]

from google.cloud import api_keys_v2
from google.cloud.api_keys_v2 import Key
Expand Down Expand Up @@ -64,4 +64,4 @@ def restrict_api_key_ios(project_id: str, key_id: str) -> Key:
# Use response.key_string to authenticate.
return response

# [END auth_cloud_restrict_api_key_ios]
# [END apikeys_restrict_api_key_ios]
4 changes: 2 additions & 2 deletions auth/api-client/restrict_api_key_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START auth_cloud_restrict_api_key_server]
# [START apikeys_restrict_api_key_server]

from google.cloud import api_keys_v2
from google.cloud.api_keys_v2 import Key
Expand Down Expand Up @@ -65,4 +65,4 @@ def restrict_api_key_server(project_id: str, key_id: str) -> Key:
# Use response.key_string to authenticate.
return response

# [END auth_cloud_restrict_api_key_server]
# [END apikeys_restrict_api_key_server]
4 changes: 2 additions & 2 deletions bigquery/bqml/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ google-cloud-bigquery[pandas,bqstorage]==2.34.4
google-cloud-bigquery-storage==2.14.0
pandas==1.1.5; python_version < '3.7'
pandas==1.3.5; python_version > '3.6'
# pyarrow must stay under 7
pyarrow==6.0.1
# pyarrow must stay under 8
pyarrow==7.0.0
flaky==3.7.0
mock==4.0.3
2 changes: 1 addition & 1 deletion bigquery/datalab-migration/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ google-cloud-bigquery[pandas,pyarrow]==2.34.4
google-cloud-bigquery-storage==2.13.2
datalab==1.2.1
ipython==8.0.1
pyarrow==6.0.1
pyarrow==7.0.0
6 changes: 4 additions & 2 deletions bigquery/pandas-gbq-migration/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ google-cloud-bigquery==2.34.4
google-cloud-bigquery-storage==2.14.0
pandas==1.1.5; python_version < '3.7'
pandas==1.3.5; python_version > '3.6'
pandas-gbq==0.16.0; python_version > '3.6'
pandas-gbq==0.17.2; python_version > '3.6'
# pandas-gbq==0.14.1 is the latest compatible version for Python 3.6
pandas-gbq==0.14.1; python_version < '3.7'
grpcio==1.47.0
pyarrow==6.0.1
pyarrow==7.0.0; python_version > '3.6'
# pyarrow==6.0.1 is the latest compatible version for pandas-gbq 0.14.1
pyarrow==6.0.1; python_version < '3.7'
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.0
google-cloud-bigquery==3.4.1
google-cloud-contact-center-insights==1.6.0
google-cloud-contact-center-insights==1.6.1
2 changes: 1 addition & 1 deletion container/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google-cloud-container==2.13.0
google-cloud-container==2.17.1
backoff==2.2.1
pytest==7.2.0
2 changes: 1 addition & 1 deletion data-science-onramp/data-processing/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pytest==7.0.1
pandas==1.1.5; python_version < '3.7'
pandas==1.3.5; python_version > '3.6'
pyarrow==6.0.1; python_version < '3.7'
pyarrow==8.0.0; python_version > '3.6'
pyarrow==11.0.0; python_version > '3.6'
google-cloud-bigquery==2.34.4
5 changes: 3 additions & 2 deletions data-science-onramp/vertex-ai/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
google-cloud-aiplatform==1.12.1
google-cloud-storage==1.44.0
google-cloud-aiplatform==1.21.0; python_version>'3.7'
google-cloud-aiplatform==1.20.0; python_version=='3.7'
google-cloud-storage==2.2.1
2 changes: 1 addition & 1 deletion documentai/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-cloud-documentai==2.6.0
google-cloud-documentai==2.10.0
google-cloud-storage==2.7.0
2 changes: 1 addition & 1 deletion iot/api-client/mqtt_example/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ google-auth-httplib2==0.1.0
google-auth==2.6.2
google-cloud-pubsub==2.9.0
google-cloud-iot==2.5.1
grpc-google-iam-v1==0.12.4
grpc-google-iam-v1==0.12.6
pyjwt==2.6.0
paho-mqtt==1.5.1
6 changes: 6 additions & 0 deletions logging/redaction/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# From apache/beam_python3.9_sdk:2.43.0
FROM apache/beam_python3.9_sdk@sha256:372abe1d342447118d517ed1325969115e2df03f09fc7604e606c7552380b2ce

# Install google-cloud-logging package that is missing in Beam SDK
COPY requirements.txt /tmp
RUN pip3 install --upgrade pip && pip3 install -r /tmp/requirements.txt && pip3 check
16 changes: 16 additions & 0 deletions logging/redaction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Logging redaction tutorial code samples

> **Warning**
> This section is still **W**ork **I**n **P**rogress.
> Cloud Shell button now opens this README. It will open the tutorial _AFTER_ its official launch.
> Tests to validate the code samples will be added.
This section contains code that is used in the "Redact confidential information in logs" tutorial.
You can open the tutorial in Cloud Shell:

[![Open in Cloud Shell][shell_img]][shell_link]

_NOTE:_ You will need a valid Google Cloud credentials to open the tutorial.

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=logging/redaction/README.md
Loading

0 comments on commit eaf47b8

Please sign in to comment.