You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The expected type for the parameters expand_tasks, completed_only, and active_only in the functions list() and list_runs() in the JobsAPI class is boolean. This is misleading and wrong in terms of what the Databricks API expects.
When supplying a True boolean value for any of these parameters, they are not applied correctly and does not return the expected values.
The reason for this is because the Databricks API expects a lowercase string: "true" or "false"
Either the conversion from boolean to lowercase string has to be implemented in the functions (list() and list_runs()) or change the type hinting of these parameters to be correct.
I do not know if this is an issue for other API endpoints.
Reproduction
The following code shows an example with the expand_tasks parameter.
The only difference between the two examples is value supplied to the parameter True and "true".
Code where list_runs does NOT return tasks:
host="..."token="..."w=WorkspaceClient(host=host, token=token)
forjobinw.jobs.list():
forruninw.jobs.list_runs(job_id=job.job_id, expand_tasks=True):
assert"tasks"inrun.as_dict(), "Did not find 'tasks' in returned job run dict"
Code where list_runs does return tasks:
host="..."token="..."w=WorkspaceClient(host=host, token=token)
forjobinw.jobs.list():
forruninw.jobs.list_runs(job_id=job.job_id, expand_tasks="true"):
assert"tasks"inrun.as_dict(), "Did not find 'tasks' in returned job run dict"
Expected behavior
I expect no missing values returned from functions when supplied with the correct parameters and that the parameters are actually applied.
Is it a regression?
I have not tested multiple versions. Only the latest.
Other Information
OS: macOS
The text was updated successfully, but these errors were encountered:
I realized after some investigation that my issue was the same as Issue #142 and that a fix had been implemented. I mistakenly assumed that I had the latest version of the SDK installed. Updating the version to the latest version (0.20.0) fixed the issue.
Description
The expected type for the parameters
expand_tasks
,completed_only
, andactive_only
in the functionslist()
andlist_runs()
in theJobsAPI
class is boolean. This is misleading and wrong in terms of what the Databricks API expects.When supplying a
True
boolean value for any of these parameters, they are not applied correctly and does not return the expected values.The reason for this is because the Databricks API expects a lowercase string:
"true"
or"false"
Either the conversion from boolean to lowercase string has to be implemented in the functions (
list()
andlist_runs()
) or change the type hinting of these parameters to be correct.I do not know if this is an issue for other API endpoints.
Reproduction
The following code shows an example with the
expand_tasks
parameter.The only difference between the two examples is value supplied to the parameter
True
and"true"
.Code where
list_runs
does NOT return tasks:Code where
list_runs
does return tasks:Expected behavior
I expect no missing values returned from functions when supplied with the correct parameters and that the parameters are actually applied.
Is it a regression?
I have not tested multiple versions. Only the latest.
Other Information
The text was updated successfully, but these errors were encountered: