Hello, I am trying to use “Filter time series” or “List time series” endpoints. However, because of 1000 limit, I need to parallelize these calls as I would like to retrieve thousands of timeseries. The challenge I am facing is the pagination used in these endpoints which is based on id of timeseries. Is there a way to use index as pagination?
Solved
Parallelize restAPI calls with pagination
+3
Best answer by Jason Dressel
client: CogniteClient = ...
print(f"Max Workers: {client.config.max_workers}") #ensure you have workers >1 :)
timeseries = client.time_series.list(limit=None) #not making use of the workers
timeseries = client.time_series.list(partitions=10, limit=None) #will leverage the workers and run in parallel
-Jason
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.