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

Make add_document_by_bytearray backward compatible #27

Open
Tracked by #24
zlove opened this issue Feb 29, 2024 · 0 comments
Open
Tracked by #24

Make add_document_by_bytearray backward compatible #27

zlove opened this issue Feb 29, 2024 · 0 comments
Assignees

Comments

@zlove
Copy link
Contributor

zlove commented Feb 29, 2024

In order to release 1.1 while respecting semantic versioning (and not introducing a breaking change), we should make add_document_by_bytearray backwards compatible. In the released version 1.0 it takes a bytearray as the first param. Currently in develop, and the unreleased main, it takes filename first and byte_array second.

I'd suggest we do 1 of 2 things:

  1. Revert add_document_by_bytearray to the original parameter order, and add a comment that the method is deprecated in favor of a new method, e.g. add_document_by_bytes. Add that new method with the correct parameter order. Change the implementation of add_document_by_bytearray to call add_document_by_bytes, to keep it DRY.
  2. Modify add_document_by_bytearray so that it can detect when filename is passed as the first param and not break.

I think approach (1) is cleaner.

@zlove zlove mentioned this issue Feb 29, 2024
3 tasks
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

No branches or pull requests

2 participants