potiuk commented on a change in pull request #6693: [AIRFLOW-6131] Make
Cassandra hooks/sensors pylint compatible
URL: https://github.com/apache/airflow/pull/6693#discussion_r352286284
##########
File path: airflow/providers/apache/cassandra/hooks/cassandra.py
##########
@@ -115,28 +123,29 @@ def get_conn(self):
self.session = self.cluster.connect(self.keyspace)
return self.session
- def get_cluster(self):
+ def get_cluster(self) -> Cluster:
+ """
+ Returns Cassandra cluster.
+ """
return self.cluster
- def shutdown_cluster(self):
+ def shutdown_cluster(self) -> None:
"""
Closes all sessions and connections associated with this Cluster.
"""
if not self.cluster.is_shutdown:
self.cluster.shutdown()
@staticmethod
- def get_lb_policy(policy_name, policy_args):
- policies = {
- 'RoundRobinPolicy': RoundRobinPolicy,
- 'DCAwareRoundRobinPolicy': DCAwareRoundRobinPolicy,
- 'WhiteListRoundRobinPolicy': WhiteListRoundRobinPolicy,
- 'TokenAwarePolicy': TokenAwarePolicy,
- }
-
- if not policies.get(policy_name) or policy_name == 'RoundRobinPolicy':
- return RoundRobinPolicy()
+ def get_lb_policy(policy_name: str, policy_args: Dict) -> Policy:
Review comment:
```suggestion
def get_lb_policy(policy_name: str, policy_args: Dict[str, str]) ->
Policy:
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services