Robert Bastian
02/24/2021, 11:11 PM@task
def get_url(run_id, hook):
logger = prefect.context.get("logger")
<http://logger.info|logger.info>("RUN ID: %s", run_id)
url = hook.get_run_page_url(run_id=run_id)
return url
SubmitRun = DatabricksSubmitRun()
with Flow("test_databricks", storage=STORAGE, run_config=RUN_CONFIG) as flow:
conn = PrefectSecret('DATABRICKS_CONNECTION_STRING')
json = get_job_config()
run_id = SubmitRun(json=json, databricks_conn_secret=conn)
hook = SubmitRun.get_hook()
url = get_url(run_id, hook)
Here is the exception:
ERROR:prefect.TaskRunner:Unexpected error: TypeError("argument of type 'NoneType' is not iterable")
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/prefect/engine/runner.py", line 48, in inner
new_state = method(self, state, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/prefect/engine/task_runner.py", line 863, in get_task_run_state
value = prefect.utilities.executors.run_task_with_timeout(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/prefect/utilities/executors.py", line 298, in run_task_with_timeout
return task.run(*args, **kwargs) # type: ignore
File "/Users/rbastian/enverus/RAI/prefect/flows/test-databricks.py", line 32, in get_url
url = hook.get_run_page_url(run_id=run_id)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/prefect/tasks/databricks/databricks_hook.py", line 248, in get_run_page_url
response = self._do_api_call(GET_RUN_ENDPOINT, json)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/prefect/tasks/databricks/databricks_hook.py", line 148, in _do_api_call
if "token" in self.databricks_conn:
Thanks in advance!