Skip to content

Make add_document_by_bytearray backward compatible #27

@zlove

Description

@zlove

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions