You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/07/15 11:33:30 UTC

[airflow] branch master updated: Improve type hinting to provider cloudant (#9825)

This is an automated email from the ASF dual-hosted git repository.

kamilbregula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 35fe972  Improve type hinting to provider cloudant (#9825)
35fe972 is described below

commit 35fe97225ee0a29aa350bb6ed805428fd707ab2f
Author: rafyzg <43...@users.noreply.github.com>
AuthorDate: Wed Jul 15 14:32:55 2020 +0300

    Improve type hinting to provider cloudant (#9825)
    
    Co-authored-by: Refael Y <re...@seadata.co.il>
---
 airflow/providers/cloudant/hooks/cloudant.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/airflow/providers/cloudant/hooks/cloudant.py b/airflow/providers/cloudant/hooks/cloudant.py
index ace0953..5dcdf25 100644
--- a/airflow/providers/cloudant/hooks/cloudant.py
+++ b/airflow/providers/cloudant/hooks/cloudant.py
@@ -32,11 +32,11 @@ class CloudantHook(BaseHook):
     :type cloudant_conn_id: str
     """
 
-    def __init__(self, cloudant_conn_id='cloudant_default'):
+    def __init__(self, cloudant_conn_id: str = 'cloudant_default') -> None:
         super().__init__()
         self.cloudant_conn_id = cloudant_conn_id
 
-    def get_conn(self):
+    def get_conn(self) -> cloudant:
         """
         Opens a connection to the cloudant service and closes it automatically if used as context manager.
 
@@ -57,7 +57,7 @@ class CloudantHook(BaseHook):
 
         return cloudant_session
 
-    def _validate_connection(self, conn):
+    def _validate_connection(self, conn: cloudant) -> None:
         for conn_param in ['login', 'password']:
             if not getattr(conn, conn_param):
                 raise AirflowException('missing connection parameter {conn_param}'.format(