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

Move DB call out of DatabricksHook.__init__ #18339

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion airflow/providers/databricks/hooks/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(
) -> None:
super().__init__()
self.databricks_conn_id = databricks_conn_id
self.databricks_conn = self.get_connection(databricks_conn_id)
self.databricks_conn = None
self.timeout_seconds = timeout_seconds
if retry_limit < 1:
raise ValueError('Retry limit must be greater than equal to 1')
Expand Down Expand Up @@ -166,6 +166,8 @@ def _do_api_call(self, endpoint_info, json):
"""
method, endpoint = endpoint_info

self.databricks_conn = self.get_connection(self.databricks_conn_id)

if 'token' in self.databricks_conn.extra_dejson:
self.log.info('Using token auth. ')
auth = _TokenAuth(self.databricks_conn.extra_dejson['token'])
Expand Down