Skip to content
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

[BUG] TypeError on calling parallel_bulk (v2.4.0) #599

Closed
evios opened this issue Nov 16, 2023 · 6 comments · Fixed by #601
Closed

[BUG] TypeError on calling parallel_bulk (v2.4.0) #599

evios opened this issue Nov 16, 2023 · 6 comments · Fixed by #601
Labels
bug Something isn't working

Comments

@evios
Copy link

evios commented Nov 16, 2023

What is the bug?

TypeError("_process_bulk_chunk() got multiple values for argument 'raise_on_exception'")

How can one reproduce the bug?

call

parallel_bulk(
            self._client,
            actions=self._session_generator(),
            chunk_size=100,
            raise_on_error=False,
            raise_on_exception=False,
            max_chunk_bytes=20 * 1024 * 1024,
            request_timeout=60,
        )

What is your host/environment?

Debian Bullseye

Do you have any additional context?

It was first found in version 2.4.0.
ignore_status transferred as 3rd positional argument in _process_bulk_chunk:

lambda bulk_chunk: list(
_process_bulk_chunk(
client, bulk_chunk[1], bulk_chunk[0], ignore_status, *args, **kwargs

but raise_on_exception expected as 3rd positional:

def _process_bulk_chunk(
client: Any,
bulk_actions: Any,
bulk_data: Any,
raise_on_exception: bool = True,
raise_on_error: bool = True,
ignore_status: Any = (),
*args: Any,
**kwargs: Any
) -> Any:

Previous versions did not have it. Version 2.3.2 snippet:

lambda bulk_chunk: list(
_process_bulk_chunk(
client,
bulk_chunk[1],
bulk_chunk[0],
ignore_status=ignore_status,
*args,
**kwargs
)

@evios evios added bug Something isn't working untriaged Need triage labels Nov 16, 2023
@evios evios changed the title [BUG] TypeError on calling parallel_bulk [BUG] TypeError on calling parallel_bulk (starting from v2.4.0) Nov 16, 2023
@dblock
Copy link
Member

dblock commented Nov 16, 2023

Likely a bug that slipped through test coverage :( Care to write a test that reproduces this? Maybe a fix?

@dblock dblock removed the untriaged Need triage label Nov 16, 2023
@dblock dblock changed the title [BUG] TypeError on calling parallel_bulk (starting from v2.4.0) [BUG] TypeError on calling parallel_bulk (v2.4.0) Nov 16, 2023
@dblock
Copy link
Member

dblock commented Nov 17, 2023

Fixed in #601, appreciate any additional eyes @evios.

@evios
Copy link
Author

evios commented Nov 17, 2023

@dblock thanks for the instant fixing. Sure, will keep an eye on the updated version :)

@dblock
Copy link
Member

dblock commented Nov 17, 2023

@evios If you want to try it from HEAD that'd be great.

@dblock
Copy link
Member

dblock commented Nov 19, 2023

We've released 2.4.2 with a fix.

@evios
Copy link
Author

evios commented Nov 20, 2023

Thank you, it works smoothly with 2.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants