Skip to content

Commit

Permalink
style: linted
Browse files Browse the repository at this point in the history
  • Loading branch information
Sciator committed Nov 22, 2023
1 parent 082231c commit 0b03780
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions influxdb_client/client/tasks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand Down

0 comments on commit 0b03780

Please sign in to comment.