You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/07/18 20:54:09 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #9875: Add type hinting for mongo provider

mik-laj commented on a change in pull request #9875:
URL: https://github.com/apache/airflow/pull/9875#discussion_r456826927



##########
File path: airflow/providers/mongo/sensors/mongo.py
##########
@@ -41,13 +43,18 @@ class MongoSensor(BaseSensorOperator):
     template_fields = ('collection', 'query')
 
     @apply_defaults
-    def __init__(self, collection, query, mongo_conn_id="mongo_default", *args, **kwargs):
+    def __init__(self,
+                 collection: str,
+                 query: dict,
+                 mongo_conn_id: str = "mongo_default",
+                 *args,
+                 **kwargs) -> None:
         super().__init__(*args, **kwargs)
         self.mongo_conn_id = mongo_conn_id
         self.collection = collection
         self.query = query
 
-    def poke(self, context):
+    def poke(self, context: Optional[dict]) -> bool:

Review comment:
       ```suggestion
       def poke(self, context: dict) -> bool:
   ```
   It's a required parameter. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org