8000 fix(dataflow): use gcloud for teardown by tmatsuo · Pull Request #4504 · GoogleCloudPlatform/python-docs-samples · GitHub
[go: up one dir, main page]

Skip to content

fix(dataflow): use gcloud for teardown #4504

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

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions dataflow/flex-templates/streaming_beam/streaming_beam_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ def topic_path():
pass
topic = publisher_client.create_topic(topic_path)
yield topic.name
publisher_client.delete_topic(topic_path)
# Due to the pinned library dependencies in apache-beam, client
# library throws an error upon deletion.
# We use gcloud for a workaround. See also:
# https://github.com/GoogleCloudPlatform/python-docs-samples/issues/4492
sp.check_call(
['gcloud', 'pubsub', '--project', PROJECT, 'topics', 'delete', TOPIC])


@pytest.fixture
Expand All @@ -53,7 +58,14 @@ def subscription_path(topic_path):
pass
subscription = subscriber.create_subscription(subscription_path, topic_path)
yield subscription.name
subscriber.delete_subscription(subscription_path)

# Due to the pinned library dependencies in apache-beam, client
# library throws an error upon deletion.
# We use gcloud for a workaround. See also:
# https://github.com/GoogleCloudPlatform/python-docs-samples/issues/4492
sp.check_call(
['gcloud', 'pubsub', '--project', PROJECT, 'subscriptions', 'delete',
SUBSCRIPTION])


@pytest.fixture
Expand Down
0