From f125de2dd3c69e002c491834f51ac3eda815d7b7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:04:22 +0000 Subject: [PATCH] chore(python): use black==22.3.0 (#147) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- contact-center-insights/snippets/create_conversation.py | 6 ++++-- .../snippets/create_conversation_with_ttl.py | 6 ++++-- contact-center-insights/snippets/create_issue_model.py | 6 ++++-- .../snippets/create_phrase_matcher_all_of.py | 6 ++++-- .../snippets/create_phrase_matcher_any_of.py | 6 ++++-- .../snippets/enable_pubsub_notifications.py | 6 ++++-- contact-center-insights/snippets/export_to_bigquery.py | 6 ++++-- contact-center-insights/snippets/noxfile.py | 4 ++-- contact-center-insights/snippets/set_project_ttl.py | 6 ++++-- contact-center-insights/snippets/test_create_analysis.py | 6 ++++-- contact-center-insights/snippets/test_create_issue_model.py | 6 ++++-- .../snippets/test_enable_pubsub_notifications.py | 6 ++++-- contact-center-insights/snippets/test_get_operation.py | 6 ++++-- contact-center-insights/snippets/test_set_project_ttl.py | 6 ++++-- 14 files changed, 54 insertions(+), 28 deletions(-) diff --git a/contact-center-insights/snippets/create_conversation.py b/contact-center-insights/snippets/create_conversation.py index d7fa5a06ebb8..8f632299b8c4 100644 --- a/contact-center-insights/snippets/create_conversation.py +++ b/contact-center-insights/snippets/create_conversation.py @@ -22,8 +22,10 @@ def create_conversation( audio_uri: str = "gs://cloud-samples-data/ccai/voice_6912.txt", ) -> contact_center_insights_v1.Conversation: # Construct a parent resource. - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) # Construct a conversation. diff --git a/contact-center-insights/snippets/create_conversation_with_ttl.py b/contact-center-insights/snippets/create_conversation_with_ttl.py index 267c71d4d65a..da68789f2a09 100644 --- a/contact-center-insights/snippets/create_conversation_with_ttl.py +++ b/contact-center-insights/snippets/create_conversation_with_ttl.py @@ -24,8 +24,10 @@ def create_conversation_with_ttl( audio_uri: str = "gs://cloud-samples-data/ccai/voice_6912.txt", ) -> contact_center_insights_v1.Conversation: # Construct a parent resource. - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) # Construct a conversation. diff --git a/contact-center-insights/snippets/create_issue_model.py b/contact-center-insights/snippets/create_issue_model.py index b34033593e77..3ebebb6e175e 100644 --- a/contact-center-insights/snippets/create_issue_model.py +++ b/contact-center-insights/snippets/create_issue_model.py @@ -18,8 +18,10 @@ def create_issue_model(project_id: str) -> contact_center_insights_v1.IssueModel: # Construct a parent resource. - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) # Construct an issue model. diff --git a/contact-center-insights/snippets/create_phrase_matcher_all_of.py b/contact-center-insights/snippets/create_phrase_matcher_all_of.py index 0824bc8a02e3..3627fb996fd9 100644 --- a/contact-center-insights/snippets/create_phrase_matcher_all_of.py +++ b/contact-center-insights/snippets/create_phrase_matcher_all_of.py @@ -20,8 +20,10 @@ def create_phrase_matcher_all_of( project_id: str, ) -> contact_center_insights_v1.PhraseMatcher: # Construct a parent resource. - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) # Construct a phrase matcher that matches all of its rule groups. diff --git a/contact-center-insights/snippets/create_phrase_matcher_any_of.py b/contact-center-insights/snippets/create_phrase_matcher_any_of.py index 33de08b26608..8494ee9ab128 100644 --- a/contact-center-insights/snippets/create_phrase_matcher_any_of.py +++ b/contact-center-insights/snippets/create_phrase_matcher_any_of.py @@ -20,8 +20,10 @@ def create_phrase_matcher_any_of( project_id: str, ) -> contact_center_insights_v1.PhraseMatcher: # Construct a parent resource. - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) # Construct a phrase matcher that matches any of its rule groups. diff --git a/contact-center-insights/snippets/enable_pubsub_notifications.py b/contact-center-insights/snippets/enable_pubsub_notifications.py index 0c7e8d976855..c363491d4b31 100644 --- a/contact-center-insights/snippets/enable_pubsub_notifications.py +++ b/contact-center-insights/snippets/enable_pubsub_notifications.py @@ -22,8 +22,10 @@ def enable_pubsub_notifications( ) -> None: # Construct a settings resource. settings = contact_center_insights_v1.Settings() - settings.name = contact_center_insights_v1.ContactCenterInsightsClient.settings_path( - project_id, "us-central1" + settings.name = ( + contact_center_insights_v1.ContactCenterInsightsClient.settings_path( + project_id, "us-central1" + ) ) settings.pubsub_notification_settings = { "create-conversation": topic_create_conversation, diff --git a/contact-center-insights/snippets/export_to_bigquery.py b/contact-center-insights/snippets/export_to_bigquery.py index 06e2e41bda8a..18af84aca916 100644 --- a/contact-center-insights/snippets/export_to_bigquery.py +++ b/contact-center-insights/snippets/export_to_bigquery.py @@ -24,8 +24,10 @@ def export_to_bigquery( ) -> None: # Construct an export request. request = contact_center_insights_v1.ExportInsightsDataRequest() - request.parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + request.parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) request.big_query_destination.project_id = bigquery_project_id request.big_query_destination.dataset = bigquery_dataset_id diff --git a/contact-center-insights/snippets/noxfile.py b/contact-center-insights/snippets/noxfile.py index 85f5836dba3a..25f87a215d4c 100644 --- a/contact-center-insights/snippets/noxfile.py +++ b/contact-center-insights/snippets/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/contact-center-insights/snippets/set_project_ttl.py b/contact-center-insights/snippets/set_project_ttl.py index b5aa02107875..c0e6431ebdd3 100644 --- a/contact-center-insights/snippets/set_project_ttl.py +++ b/contact-center-insights/snippets/set_project_ttl.py @@ -22,8 +22,10 @@ def set_project_ttl(project_id: str) -> None: # Construct a settings resource. settings = contact_center_insights_v1.Settings() - settings.name = contact_center_insights_v1.ContactCenterInsightsClient.settings_path( - project_id, "us-central1" + settings.name = ( + contact_center_insights_v1.ContactCenterInsightsClient.settings_path( + project_id, "us-central1" + ) ) conversation_ttl = duration_pb2.Duration() diff --git a/contact-center-insights/snippets/test_create_analysis.py b/contact-center-insights/snippets/test_create_analysis.py index df41dbd8f5a8..e78d925ee98d 100644 --- a/contact-center-insights/snippets/test_create_analysis.py +++ b/contact-center-insights/snippets/test_create_analysis.py @@ -35,8 +35,10 @@ def conversation_resource(project_id): # Create a conversation. insights_client = contact_center_insights_v1.ContactCenterInsightsClient() - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) conversation = contact_center_insights_v1.Conversation() diff --git a/contact-center-insights/snippets/test_create_issue_model.py b/contact-center-insights/snippets/test_create_issue_model.py index ffa60e4f3b72..b978242cf5f7 100644 --- a/contact-center-insights/snippets/test_create_issue_model.py +++ b/contact-center-insights/snippets/test_create_issue_model.py @@ -40,8 +40,10 @@ def count_conversations(project_id, insights_client): # See https://cloud.google.com/contact-center/insights/docs/topic-model. list_request = contact_center_insights_v1.ListConversationsRequest() list_request.page_size = 1000 - list_request.parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + list_request.parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) conversations = insights_client.list_conversations(request=list_request) conversation_count = len(list(conversations)) diff --git a/contact-center-insights/snippets/test_enable_pubsub_notifications.py b/contact-center-insights/snippets/test_enable_pubsub_notifications.py index 42eb87d9ab6a..d7c0369616e1 100644 --- a/contact-center-insights/snippets/test_enable_pubsub_notifications.py +++ b/contact-center-insights/snippets/test_enable_pubsub_notifications.py @@ -58,8 +58,10 @@ def pubsub_topics(project_id): def disable_pubsub_notifications(project_id): yield settings = contact_center_insights_v1.Settings() - settings.name = contact_center_insights_v1.ContactCenterInsightsClient.settings_path( - project_id, "us-central1" + settings.name = ( + contact_center_insights_v1.ContactCenterInsightsClient.settings_path( + project_id, "us-central1" + ) ) settings.pubsub_notification_settings = {} update_mask = field_mask_pb2.FieldMask() diff --git a/contact-center-insights/snippets/test_get_operation.py b/contact-center-insights/snippets/test_get_operation.py index f7e859ed7777..4f6bc8b51eb4 100644 --- a/contact-center-insights/snippets/test_get_operation.py +++ b/contact-center-insights/snippets/test_get_operation.py @@ -38,8 +38,10 @@ def insights_client(): @pytest.fixture def conversation_resource(project_id, insights_client): # Create a conversation. - parent = contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( - project_id, "us-central1" + parent = ( + contact_center_insights_v1.ContactCenterInsightsClient.common_location_path( + project_id, "us-central1" + ) ) conversation = contact_center_insights_v1.Conversation() diff --git a/contact-center-insights/snippets/test_set_project_ttl.py b/contact-center-insights/snippets/test_set_project_ttl.py index 50605b5da8dc..34a657cc2972 100644 --- a/contact-center-insights/snippets/test_set_project_ttl.py +++ b/contact-center-insights/snippets/test_set_project_ttl.py @@ -32,8 +32,10 @@ def project_id(): def clear_project_ttl(project_id): yield settings = contact_center_insights_v1.Settings() - settings.name = contact_center_insights_v1.ContactCenterInsightsClient.settings_path( - project_id, "us-central1" + settings.name = ( + contact_center_insights_v1.ContactCenterInsightsClient.settings_path( + project_id, "us-central1" + ) ) settings.conversation_ttl = None update_mask = field_mask_pb2.FieldMask()