Skip to content

Commit

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

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 committed Jan 29, 2024
1 parent 52063a4 commit 7def2bc
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, **kwargs):
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 7def2bc

Please sign in to comment.