I am trying to use databricks inbuilt operator provided by airflow such as DatabricksSubmitRunOperator or DatabricksRunNowOperator but i am not able to use it, it gives below error:
Attempt 1 API Request to Databricks failed with reason: HTTPSConnectionPool(host='usdev.databaricks.xyz.com', port=443): Max retries exceeded with url: /api/2.0/jobs/run-now (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)'))
if i were to use custom python code then i can supply verify = False in requests module of python but since i am using this inbuilt operator i don't see any option to disable the ssl validation from airflow to databricks.
sample code being used:
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from airflow.providers.databricks.operators.databricks import (
DatabricksRunNowOperator,
)
from datetime import datetime, timedelta
"""
SUCCESS SCENARIO.
- It will run the job_id=14, that is already created in databricks.
- Basically, it will trigger what that job is supposed to do (that is, run a notebook)
"""
# Define params for Run Now Operator
notebook_params = {"Variable": 5}
with DAG(
"databricks_dag_run_now",
start_date=datetime(2021, 1, 1),
schedule_interval="@daily",
catchup=False,
default_args={
"email_on_failure": False,
"email_on_retry": False,
"retry_delay": timedelta(minutes=2),
},
) as dag:
t0 = DummyOperator(
task_id='start'
)
opr_run_now = DatabricksRunNowOperator(
task_id="run_now",
databricks_conn_id="custom_databricks_conn",
job_id=12345,
notebook_params=notebook_params,
)
t0 >> opr_run_now