Skip to content

Commit

Permalink
Improve type hinting to provider cloudant (#9825)
Browse files Browse the repository at this point in the history
Co-authored-by: Refael Y <refael@seadata.co.il>
  • Loading branch information
rafyzg and Refael Y committed Jul 15, 2020
1 parent a0493bd commit 35fe972
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions airflow/providers/cloudant/hooks/cloudant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -57,7 +57,7 @@ def get_conn(self):

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(
Expand Down

0 comments on commit 35fe972

Please sign in to comment.