Nicholas Chammas
07/01/2021, 5:50 PMParameter
being fed into a DatabricksRunNow
Task
as a notebook_param
. I can see the edge between the parameter and the task in the UI fine, but for whatever reason the Databricks notebook is not receiving the parameter value when I run the flow.
What should I try to troubleshoot the reason why the notebook task is not receiving parameter values?Nicholas Chammas
07/01/2021, 5:51 PMKevin Kho
DatabricksRunNow
task and how you pass it in? Just remove any sensitive stuff.Nicholas Chammas
07/01/2021, 5:54 PMdef databricks_job(job_id, **kwargs):
if "name" in kwargs:
name_prefix = f"{kwargs['name']} - "
else:
name_prefix = ""
kwargs.setdefault("task_run_name", f"{name_prefix}databricks_job[{job_id}]")
kwargs.update(job_id=job_id)
return DatabricksRunNow(**kwargs)
GenerateCounts = databricks_job(
name="Generate Counts",
job_id=GENERATE_COUNTS_JOB_ID,
)
with le_flow(name="...", state_handlers=[HANDLER]) as flow:
version = Parameter("version", required=True)
generate_counts = GenerateCounts(
databricks_conn_secret=DATABRICKS_CONN,
notebook_params={
"attemptId": version,
},
)
Kevin Kho
notebook_params
does not get passed?Nicholas Chammas
07/01/2021, 6:12 PMversion
inside "attemptId": version,
with a plain string, the notebook still doesn’t get any parameters.
I guess the problem is not the parameter then! That’s an obvious test I should have tried. 😅
Guess I need to understand what’s going wrong with notebook_params
to begin with.Kevin Kho
Nicholas Chammas
07/01/2021, 6:40 PMKevin Kho
Kevin Kho
Task.run()
without using a Flow?Nicholas Chammas
07/01/2021, 9:00 PMnotebook_params
as static kwargs (i.e. alongside things like name
and job_id
) it works, but when I provide them as runtime/dynamic kwargs
that’s when they are being ignored.
I’ll try Task.run()
and report back.Kevin Kho
Nicholas Chammas
07/06/2021, 7:43 PMKevin Kho