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

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Dec 7, 2023

Type a few task-related items

Closes: #11105

Type a few task-related items
Copy link
Contributor

github-actions bot commented Dec 7, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉


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

@JelleZijlstra JelleZijlstra merged commit 00ec3fe into python:main Feb 5, 2024
@srittau srittau deleted the influxdb-1.39 branch February 5, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants