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): Add Dataflow to Pub/Sub snippet #11104

Merged
merged 8 commits into from
Jan 14, 2024

Conversation

VeronicaWasson
Copy link
Contributor

@VeronicaWasson VeronicaWasson commented Jan 5, 2024

Description

Adds a snippet that shows how to write messages to Pub/Sub from Dataflow.

Bug: b/310239684
Doc bug: b/318728052 (Parent doc bug for context: b/309130866)

Checklist

Adds a snippet that shows how to write messages to Pub/Sub from
Dataflow.
@VeronicaWasson VeronicaWasson requested review from a team as code owners January 5, 2024 21:44
Copy link

snippet-bot bot commented Jan 5, 2024

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jan 5, 2024
dataflow/snippets/noxfile_config.py Outdated Show resolved Hide resolved
dataflow/snippets/noxfile_config.py Show resolved Hide resolved
dataflow/snippets/tests/test_write_pubsub.py Outdated Show resolved Hide resolved
dataflow/snippets/write_pubsub.py Outdated Show resolved Hide resolved
dataflow/snippets/write_pubsub.py Outdated Show resolved Hide resolved
"ignored_versions": ["2.7", "3.7", "3.9", "3.10", "3.12"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For new samples we recommend using type hints, they make the code more self-documented and easier to understand.

Type hints can sometimes be a little tricky to figure out, so feel free to ask if you need any help with any of them.

I believe you can run the type checks with nox -s lint (more info).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks -- I added type hints. I'm not super familiar with them, so let me know if anything looks wonky!

dataflow/snippets/write_pubsub.py Outdated Show resolved Hide resolved
dataflow/snippets/tests/test_write_pubsub.py Outdated Show resolved Hide resolved
@davidcavazos davidcavazos merged commit 93429e0 into GoogleCloudPlatform:main Jan 14, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants