cuddly-jelly-27016
05/28/2025, 8:55 AMspark_conf is not defined, neither under databricks_conf nor at top level, eg.
task_conf=Databricks(
databricks_conf={
"run_name": "flyte agent basic worfkflow test",
"new_cluster": {
"apply_policy_default_values": "true",
"aws_attributes": {
"instance_profile_arn": "...",
"availability": "ON_DEMAND"
},
"docker_image": {
"url": "..."
},
"node_type_id": "m5.large",
"num_workers": 1,
"policy_id": "...",
}
)
@task(task_config=task_conf)
def example_task():
...
@workflow
def wf():
example_task()
• run the task
### ACTUAL RESULT
Task failed with this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flytekit/extend/backend/agent_service.py", line 102, in wrapper
res = await func(self, request, context, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/flytekit/extend/backend/agent_service.py", line 120, in CreateTask
resource_meta = await mirror_async_methods(
File "/usr/local/lib/python3.10/site-packages/flytekitplugins/spark/agent.py", line 73, in create
data = json.dumps(_get_databricks_job_spec(task_template, task_execution_metadata))
File "/usr/local/lib/python3.10/site-packages/flytekitplugins/spark/agent.py", line 45, in _get_databricks_job_spec
new_cluster["spark_conf"] = custom["sparkConf"]
KeyError: 'sparkConf'
Message:
KeyError: 'sparkConf'.
### Expected behavior
Task succeeded.
This code block should default to an empty dictionary when neither new_cluster['spark_conf'] nor custom['sparkConf]` is defined.
### Additional context to reproduce
Either adding a dummy spark_conf at top level:
task_conf=Databricks(
spark_conf={
"x": "y"
},
databricks_conf={
...
}
)
or adding under `databricks_conf`:
task_conf=Databricks(
databricks_conf={
...,
spark_conf={
"x": "y"
},
...
}
)
can be used as a workaround.
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
06/06/2025, 9:06 PM