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

fix: Fix parameter mismatch in EPUBBookLoaderHelper.translate_with_ba… #429

Merged

Conversation

anenin23
Copy link
Contributor

@anenin23 anenin23 commented Nov 6, 2024

Problem

The translate_with_backoff method in EPUBBookLoaderHelper class was raising TypeError because of parameter mismatch between the method signature and actual calls through the backoff decorator.

Error message:
TypeError: EPUBBookLoaderHelper.translate_with_backoff() takes 1 positional argument but 3 were given

Solution

  1. Modified the method signature to properly handle parameters:

    • Added explicit parameters for text and context_flag
    • Added jitter=None to backoff decorator
  2. Improved error handling and logging
    #bug

…ckoff

- Fix TypeError when calling translate_with_backoff with multiple arguments
- Add proper parameter handling in the decorated method
- Add jitter=None to prevent extra parameters from backoff decorator
- Improve code readability and error handling
@yihong0618
Copy link
Owner

can you fix the lint?
pip install -U black
black .

@anenin23
Copy link
Contributor Author

anenin23 commented Nov 6, 2024

can you fix the lint? pip install -U black black .

OK done!

@yihong0618
Copy link
Owner

Thanks

@yihong0618 yihong0618 merged commit e962a08 into yihong0618:main Nov 6, 2024
2 checks passed
@anenin23 anenin23 deleted the fix/translate-with-backoff-params branch November 6, 2024 10:12
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.

3 participants