Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(samples): Update Topic with Kinesis Ingestion Settings #1123

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
🦉 Updates from OwlBot post-processor
  • Loading branch information
gcf-owl-bot[bot] committed Mar 14, 2024
commit 04cfb213077ae0cabfc0308f64a11bb85e17975e
5 changes: 2 additions & 3 deletions samples/snippets/publisher.py
Expand Up @@ -142,8 +142,7 @@ def update_topic_kinesis_ingestion(
)
),
),
update_mask=field_mask_pb2.FieldMask(
paths=["ingestion_data_source_settings"]),
update_mask=field_mask_pb2.FieldMask(paths=["ingestion_data_source_settings"]),
)

topic = publisher.update_topic(request=update_request)
Expand Down Expand Up @@ -531,7 +530,7 @@ def detach_subscription(project_id: str, subscription_id: str) -> None:
create_topic_kinesis_ingestion_parser.add_argument("consumer_arn")
create_topic_kinesis_ingestion_parser.add_argument("aws_role_arn")
create_topic_kinesis_ingestion_parser.add_argument("gcp_service_account")

update_topic_kinesis_ingestion_parser = subparsers.add_parser(
"update_kinesis_ingestion", help=update_topic_kinesis_ingestion.__doc__
)
Expand Down
9 changes: 5 additions & 4 deletions samples/snippets/publisher_test.py
Expand Up @@ -160,7 +160,8 @@ def test_create_kinesis_ingestion(

# Clean up resource created for the test.
publisher_client.delete_topic(request={"topic": topic_path})



def test_update_kinesis_ingestion(
publisher_client: pubsub_v1.PublisherClient, capsys: CaptureFixture[str]
) -> None:
Expand All @@ -184,7 +185,7 @@ def test_update_kinesis_ingestion(

out, _ = capsys.readouterr()
assert f"Created topic: {topic_path}" in out

publisher.update_topic_kinesis_ingestion(
PROJECT_ID,
TOPIC_ID,
Expand All @@ -193,10 +194,10 @@ def test_update_kinesis_ingestion(
aws_role_arn,
gcp_service_account,
)

out, _ = capsys.readouterr()
assert f"Updated topic: {topic_path} with AWS Kinesis Ingestion Settings" in out

# Clean up resource created for the test.
publisher_client.delete_topic(request={"topic": topic_path})

Expand Down