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

[AIRFLOW-XXX] Add How-To-Guide to GCP PubSub #401

Closed
wants to merge 5 commits into from
Closed

Conversation

TobKed
Copy link
Member

@TobKed TobKed commented Oct 24, 2019

Make sure you have checked all steps below.

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title. For example, "[AIRFLOW-XXX] My Airflow PR"
    • https://issues.apache.org/jira/browse/AIRFLOW-XXX
    • In case you are fixing a typo in the documentation you can prepend your commit with [AIRFLOW-XXX], code changes always need a Jira issue.
    • In case you are proposing a fundamental code change, you need to create an Airflow Improvement Proposal (AIP).
    • In case you are adding a dependency, check if the license complies with the ASF 3rd Party License Policy.

Description

  • Here are some details about my PR, including screenshots of any UI changes:

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

@@ -572,6 +588,10 @@ def execute(self, context):
class PubSubPublishOperator(BaseOperator):
"""Publish messages to a PubSub topic.

.. seealso::
For more information on how to use this operator, take a look at the guide:
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure about the comma, @mschickensoup WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

This sentence is used widely with comma 🤔 . Is it proper sentence @mschickensoup ?

Choose a reason for hiding this comment

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

It's correct, feel free to leave it as it is :-) -> https://developers.google.com/style/cross-references?hl=vi

@codecov-io
Copy link

codecov-io commented Oct 31, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@45e108d). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #401   +/-   ##
=========================================
  Coverage          ?   83.47%           
=========================================
  Files             ?      632           
  Lines             ?    36644           
  Branches          ?        0           
=========================================
  Hits              ?    30588           
  Misses            ?     6056           
  Partials          ?        0
Impacted Files Coverage Δ
airflow/gcp/example_dags/example_pubsub.py 100% <ø> (ø)
airflow/gcp/sensors/pubsub.py 94.28% <ø> (ø)
airflow/gcp/operators/pubsub.py 90.69% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45e108d...e031578. Read the comment docs.

@TobKed
Copy link
Member Author

TobKed commented Nov 4, 2019

PR to apache created: apache#6497

on Google Cloud Platform or elsewhere on the Internet.

Publisher applications can send messages to a topic and other applications can subscribe to that topic to receive the messages.
By decoupling senders and receivers, Google Cloud PubSub allows developers to communicate between independently written applications.
Copy link

Choose a reason for hiding this comment

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

Suggested change
By decoupling senders and receivers, Google Cloud PubSub allows developers to communicate between independently written applications.
By decoupling senders and receivers Google Cloud PubSub allows developers to communicate between independently written applications.

Creating a PubSub subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The subscription is named resource representing the stream of messages from a single, specific topic,

Choose a reason for hiding this comment

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

Is this subscription any kind of subscription or you're referring to the specific one?

Deleting a PubSub subscription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :class:`~airflow.providers.google.cloud.operators.pubsub.PubSubSubscriptionDeleteOperator` operator would delete a subscription.

Choose a reason for hiding this comment

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

Suggested change
The :class:`~airflow.providers.google.cloud.operators.pubsub.PubSubSubscriptionDeleteOperator` operator would delete a subscription.
The :class:`~airflow.providers.google.cloud.operators.pubsub.PubSubSubscriptionDeleteOperator` operator deletes the subscription.

Please, don't use would:3 BTW, are you again referring to the specific subscription in lights of the class you mentioned?

Deleting a PubSub topic
^^^^^^^^^^^^^^^^^^^^^^^

The :class:`~airflow.providers.google.cloud.operators.pubsub.PubSubTopicDeleteOperator` operator would delete a topic.

Choose a reason for hiding this comment

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

Suggested change
The :class:`~airflow.providers.google.cloud.operators.pubsub.PubSubTopicDeleteOperator` operator would delete a topic.
The :class:`~airflow.providers.google.cloud.operators.pubsub.PubSubTopicDeleteOperator` operator deletes a topic.

No would pls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants