Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bump influxdb-client to 1.39.* #11116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stubs/influxdb-client/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.38.*"
version = "1.39.*"
upstream_repository = "https://github.com/influxdata/influxdb-client-python"
# requires a version of urllib3 with a py.typed file
requires = ["urllib3>=2"]
Expand Down
11 changes: 9 additions & 2 deletions stubs/influxdb-client/influxdb_client/client/tasks_api.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
from collections.abc import Iterator
from datetime import datetime

from influxdb_client import LabelResponse, LogEvent, Run, Task, TaskCreateRequest, TaskUpdateRequest
from influxdb_client import LabelResponse, LogEvent, Run, TaskCreateRequest, TaskUpdateRequest
from influxdb_client.domain.task import Task

class TasksApi:
def __init__(self, influxdb_client) -> None: ...
def find_task_by_id(self, task_id) -> Task: ...
def find_tasks(self, **kwargs): ...
def find_tasks(
Copy link
Collaborator

@Avasam Avasam Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanna know your opinion on this: Even though it's undocumented in this specific method, all other kwargs are passed directly to TasksService.get_tasks, would it be simpler to keep track if the definitions were all just the same? You also wouldn't have a partially unknown **kwargs.

I think this definition could be improved either way:
TasksService.get_tasks is also overloaded based on async_req. Passing async_req=True in TasksApi.find_tasks would fail because .tasks would be called on a ApplyResult. The current definition of TasksApi.find_tasks with **kwargs allows that. We could enforce async_req: Literal[False] = ... here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating this. Technically, you can pass all those arguments to it, even async_req, but I'm not sure this is actually intended. Especially in the case of async_req.

Maybe @bednar could provide some insight: Should the functions in _api.py that call call_api under the hood accept the additional keyword arguments that call_api accepts? Including async_req?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of passing **kwargs from _api.py to _service.py is to provide a flexible way to forward query parameters to HTTP requests. This design allows any number of additional keyword arguments (parameters) to be passed through the API layer directly to the service layer, which then constructs and executes the HTTP request

self, *, name: str = ..., after: str = ..., user: str = ..., org: str = ..., org_id: str = ..., limit: int = ..., **kwargs
) -> list[Task]: ...
def find_tasks_iter(
self, *, name: str = ..., after: str = ..., user: str = ..., org: str = ..., org_id: str = ..., limit: int = ..., **kwargs
) -> Iterator[Task]: ...
def create_task(self, task: Task | None = None, task_create_request: TaskCreateRequest | None = None) -> Task: ...
def create_task_every(self, name, flux, every, organization) -> Task: ...
def create_task_cron(self, name: str, flux: str, cron: str, org_id: str) -> Task: ...
Expand Down
32 changes: 15 additions & 17 deletions stubs/influxdb-client/influxdb_client/domain/tasks.pyi
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from _typeshed import Incomplete
from typing import Any, ClassVar

from influxdb_client.domain.links import Links
from influxdb_client.domain.task import Task

class Tasks:
openapi_types: Incomplete
attribute_map: Incomplete
discriminator: Incomplete
def __init__(self, links: Incomplete | None = None, tasks: Incomplete | None = None) -> None: ...
@property
def links(self): ...
@links.setter
def links(self, links) -> None: ...
@property
def tasks(self): ...
@tasks.setter
def tasks(self, tasks) -> None: ...
def to_dict(self): ...
def to_str(self): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
openapi_types: ClassVar[dict[str, str]]
attribute_map: ClassVar[dict[str, str]]

tasks: list[Task]
links: Links
discriminator: None
def __init__(self, links: Links | None = None, tasks: list[Task] | None = None) -> None: ...
def to_dict(self) -> dict[str, Any]: ...
def to_str(self) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
66 changes: 64 additions & 2 deletions stubs/influxdb-client/influxdb_client/service/tasks_service.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from _typeshed import Incomplete
from multiprocessing.pool import ApplyResult
from typing import overload
from typing_extensions import Literal

from influxdb_client.domain.tasks import Tasks
from influxdb_client.service._base_service import _BaseService

class TasksService(_BaseService):
Expand All @@ -19,8 +23,66 @@ class TasksService(_BaseService):
def delete_tasks_id_runs_id(self, task_id, run_id, **kwargs): ...
def delete_tasks_id_runs_id_with_http_info(self, task_id, run_id, **kwargs): ...
async def delete_tasks_id_runs_id_async(self, task_id, run_id, **kwargs): ...
def get_tasks(self, **kwargs): ...
def get_tasks_with_http_info(self, **kwargs): ...
@overload
def get_tasks(
self,
*,
async_req: Literal[True],
urlopen_kw=...,
zap_trace_span: str = ...,
name: str = ...,
after: str = ...,
user: str = ...,
org: str = ...,
org_id: str = ...,
limit: int = ...,
type: str = ...,
) -> ApplyResult[Tasks]: ...
@overload
def get_tasks(
self,
*,
async_req: Literal[False] = ...,
urlopen_kw=...,
zap_trace_span: str = ...,
name: str = ...,
after: str = ...,
user: str = ...,
org: str = ...,
org_id: str = ...,
limit: int = ...,
type: str = ...,
) -> Tasks: ...
@overload
def get_tasks_with_http_info(
self,
*,
async_req: Literal[True],
urlopen_kw=...,
zap_trace_span: str = ...,
name: str = ...,
after: str = ...,
user: str = ...,
org: str = ...,
org_id: str = ...,
limit: int = ...,
type: str = ...,
) -> ApplyResult[Tasks]: ...
@overload
def get_tasks_with_http_info(
self,
*,
async_req: Literal[False] = ...,
urlopen_kw=...,
zap_trace_span: str = ...,
name: str = ...,
after: str = ...,
user: str = ...,
org: str = ...,
org_id: str = ...,
limit: int = ...,
type: str = ...,
) -> Tasks: ...
async def get_tasks_async(self, **kwargs): ...
def get_tasks_id(self, task_id, **kwargs): ...
def get_tasks_id_with_http_info(self, task_id, **kwargs): ...
Expand Down