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:
- 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.
- 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.
In order to release 1.1 while respecting semantic versioning (and not introducing a breaking change), we should make
add_document_by_bytearraybackwards compatible. In the released version 1.0 it takes a bytearray as the first param. Currently indevelop, and the unreleasedmain, it takesfilenamefirst andbyte_arraysecond.I'd suggest we do 1 of 2 things:
add_document_by_bytearrayto 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 ofadd_document_by_bytearrayto calladd_document_by_bytes, to keep it DRY.add_document_by_bytearrayso that it can detect when filename is passed as the first param and not break.I think approach (1) is cleaner.