From 0b03780bcb95396c8cae3196ec6de2d10bd0a77c Mon Sep 17 00:00:00 2001 From: Sciator <39964450+Sciator@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:02:16 +0100 Subject: [PATCH] style: linted --- influxdb_client/client/tasks_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/influxdb_client/client/tasks_api.py b/influxdb_client/client/tasks_api.py index 774a4e0a..7634cbc0 100644 --- a/influxdb_client/client/tasks_api.py +++ b/influxdb_client/client/tasks_api.py @@ -10,6 +10,7 @@ from influxdb_client import TasksService, Task, TaskCreateRequest, TaskUpdateRequest, LabelResponse, LabelMapping, \ AddResourceMemberRequestBody, RunManually, Run, LogEvent + class TasksIterator: def __init__(self, values, next) -> None: self.values = values @@ -69,9 +70,10 @@ def _find_tasks_paged(self, **kwargs): has_next = tasks_response.links.next is not None last_id = tasks[-1].id if tasks else None + def next(): if has_next and last_id is not None: - return self._find_tasks_paged(**{**kwargs, 'after': last_id}) + return self._find_tasks_paged(**{**kwargs, 'after': last_id}) else: return [], None @@ -89,7 +91,7 @@ def find_tasks_iter(self, **kwargs): :return: Tasks iterator """ tasks, next = self._find_tasks_paged(**kwargs) - + return iter(TasksIterator(tasks, next)) def create_task(self, task: Task = None, task_create_request: TaskCreateRequest = None) -> Task: