Skip to content

Commit

Permalink
Deprecate DatabricksSubmitRunOperatorAsync and DatabricksRunNowOperat…
Browse files Browse the repository at this point in the history
…orAsync (#1460)

* Deprecate DatabricksSubmitRunOperatorAsync and DatabricksRunNowOperatorAsync

This PR deprecates the operators DatabricksSubmitRunOperatorAsync
and DatabricksRunNowOperatorAsync from the databricks provider
by proxying them to their Airflow OSS provider's counterpart.

closes: #1416
  • Loading branch information
pankajkoti authored Jan 29, 2024
1 parent 1c3ec6e commit 84cfc6b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 907 deletions.
23 changes: 10 additions & 13 deletions astronomer/providers/databricks/hooks/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import base64
import warnings
from typing import Any, Dict, cast

import aiohttp
Expand All @@ -21,21 +22,17 @@

class DatabricksHookAsync(DatabricksHook):
"""
Interact with Databricks.
:param databricks_conn_id: Reference to the Databricks connection.
:type databricks_conn_id: str
:param timeout_seconds: The amount of time in seconds the requests library
will wait before timing-out.
:type timeout_seconds: int
:param retry_limit: The number of times to retry the connection in case of
service outages.
:type retry_limit: int
:param retry_delay: The number of seconds to wait between retries (it
might be a floating point number).
:type retry_delay: float
This class is deprecated and will be removed in 2.0.0.
Use :class: `~airflow.providers.databricks.hooks.databricks.DatabricksHook` instead.
"""

def __init__(self, *args: Any, **kwargs: Any):
warnings.warn(
"This class is deprecated and will be removed in 2.0.0. "
"Use `airflow.providers.databricks.hooks.databricks.DatabricksHook` instead "
)
super().__init__(*args, **kwargs)

async def get_run_state_async(self, run_id: str) -> RunState:
"""
Retrieves run state of the run using an asynchronous api call.
Expand Down
Loading

0 comments on commit 84cfc6b

Please sign in to comment.