Hi guys I'm trying Prefect Cloud in a trial accou...
# prefect-cloud
l
Hi guys I'm trying Prefect Cloud in a trial account and I'm trying to run an existing AWS Databricks existing job. Here is my current code :
Copy code
from prefect import flow, task

from prefect_databricks import DatabricksCredentials
from prefect_databricks.flows import (
    jobs_runs_submit_by_id_and_wait_for_completion,
)


@task(name='First notebook')
def first_task(databricks_credentials_block_name: str, job_id: int):
    databricks_credentials = DatabricksCredentials.load(name=databricks_credentials_block_name)

    run = jobs_runs_submit_by_id_and_wait_for_completion(
        databricks_credentials=databricks_credentials, job_id=job_id, notebook_params={"app_name": "prefect1"}
    )

    return run


@flow(
    name='My Databricks Jobs orchestration'
)
def existing_job_submit(databricks_credentials_block_name: str = "dbk", job_id: int = 123456):
    first = first_task(databricks_credentials_block_name=databricks_credentials_block_name, job_id=job_id)
    return first

if __name__ == "__main__":
    existing_job_submit.serve(name="DBK-tests", tags=["dbk"], parameters={"databricks_credentials_block_name": "dbk", "job_id": 123456})
I've created a DBK block with my URL and token but I've the following error :
httpcore.ConnectError: [Errno 11001] getaddrinfo failed
Which seems a quite low-level issue (network issue ?). My databricks account is publicly accessible, so I don't understand what is going on here ... Any help appreciated 🙂