From 213860d19995ca5d089198aa13c153013e4ffdbe 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/influxdb_client/client/tasks_api.py b/influxdb_client/client/tasks_api.py index 774a4e0a..deef72c3 100644 --- a/influxdb_client/client/tasks_api.py +++ b/influxdb_client/client/tasks_api.py @@ -10,7 +10,8 @@ from influxdb_client import TasksService, Task, TaskCreateRequest, TaskUpdateRequest, LabelResponse, LabelMapping, \ AddResourceMemberRequestBody, RunManually, Run, LogEvent -class TasksIterator: + +class _TasksIterator: def __init__(self, values, next) -> None: self.values = values self.next = next @@ -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,8 +91,8 @@ def find_tasks_iter(self, **kwargs): :return: Tasks iterator """ tasks, next = self._find_tasks_paged(**kwargs) - - return iter(TasksIterator(tasks, next)) + + return iter(_TasksIterator(tasks, next)) def create_task(self, task: Task = None, task_create_request: TaskCreateRequest = None) -> Task: """Create a new task."""