the exception:
lakefs_sdk.exceptions.ApiTypeError: Got an unexpected keyword argument 'read_only' to method create_repository
Bug Fix
Previously, create() received read_only as part of the kwargs object, which was passed to sdk_client.repositories_api.create_repository(repository_creation, **kwargs). This raised an exception because create_repository()only accepts specific keyword arguments.
Fix: I added the read_only parameter to create(), passing it to the RepositoryCreation constructor, which already supports this parameter. This way, read_only is passed to create_repository() through the repository_creation object instead of via kwargs.
Testing Details
I ran setup.py after the code change and created both a read-only and a regular repo using Repository.create().
Closes #7848
Background
Currently the following code raises an exception
the exception:
lakefs_sdk.exceptions.ApiTypeError: Got an unexpected keyword argument 'read_only' to method create_repository
Bug Fix
Previously,
create()
received read_only as part of the kwargs object, which was passed tosdk_client.repositories_api.create_repository(repository_creation, **kwargs)
. This raised an exception becausecreate_repository()
only accepts specific keyword arguments.Fix: I added the read_only parameter to
create()
, passing it to theRepositoryCreation
constructor, which already supports this parameter. This way, read_only is passed tocreate_repository()
through therepository_creation
object instead of via kwargs.Testing Details
I ran setup.py after the code change and created both a read-only and a regular repo using
Repository.create()
.Contact Details
tkalir@gmail.com \ Tamar Kalir in slack