cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

GET /api/2.2/jobs/list Ordering

AlexMc
New Contributor II

Hi there!

I am calling the job list API (via the Python SDK):

GET /api/2.2/jobs/list

docs.databricks.com/api/workspace/jobs/list

Does anyone know what ordering is applied / calculated for the list of jobs? 
Is it consistent or random?
Is it by creation time?

Thanks,
Alex

1 ACCEPTED SOLUTION

Accepted Solutions

AlexMc
New Contributor II

Thanks both - this was very helpful!

View solution in original post

6 REPLIES 6

BigRoux
Databricks Employee
Databricks Employee
 
The API documentation does not explicitly specify the order in which jobs are returned. Anecdotal evidence suggests that the default ordering is descending by creation time. Additionally, such ordering seems to remain consistent across API calls unless altered by pagination or filtering.
 
To verify this, I also reviewed internal (non-public facing) documentation, which states:
"The response from the Databricks Jobs API /api/2.2/jobs/list does not explicitly define the ordering of jobs in the returned list within the provided documentation. There is no confirmed indication in the referenced materials whether jobs are ordered consistently or by specific fields such as creation time. Hence, it is likely that the ordering could be either random or implementation-dependent."
I hope this information proves helpful.
 
Best regards,
Louis

AlexMc
New Contributor II

Hi Louis,

Thanks very much for the timely and helpful response!

I had a follow up question, if I may.
With the tasks list in the jobs, is that ordered in any particular way eg. creation time etc

Kind regards,
Alex

aayrm5
Honored Contributor

Hey @AlexMc 
Per my experience with Rest APIs, the job or task list would be random. I couldn't see if there's any pattern or sorting by runtime or anything.

Thanks,

Riz

BigRoux
Databricks Employee
Databricks Employee

I suspect that if the jobs are random then the tasks within a job will be random too. Louis

AlexMc
New Contributor II

Thanks both - this was very helpful!

BigRoux
Databricks Employee
Databricks Employee

If you have a chance pluse "like" and if you are satisfied accept this as a solution. Cheers, Louis.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now