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 213860d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions influxdb_client/client/tasks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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,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."""
Expand Down

0 comments on commit 213860d

Please sign in to comment.