Nicholas Junge
10/16/2023, 1:43 PMlakefs-spec to the newly released lakefs-sdk , and it seems to have regressed in objects_api.upload_object .
When attempting to pass file descriptors like I would in lakefs-client , pydantic asks for a str | bytes instead, and when I then pass f.read() , it fails in the _WrappedApiClient.files_parameters when trying to assign a name attribute (https://github.com/treeverse/lakeFS/blob/571091ffffa9a8d033c09ef466825f8385c38f16/clients/python/lakefs_sdk/client.py#L36), which IIUC is legacy code that was designed to handle passing of some IO types to the lakeFS client.
Just meant as a heads-up, we will stay on lakefs-client for the time being. Should I put this in a GitHub issue as well?Jonathan Rosenberg
10/16/2023, 1:58 PMJonathan Rosenberg
10/16/2023, 2:01 PMNicholas Junge
10/16/2023, 2:08 PMself = <lakefs_sdk.client._WrappedApiClient object at 0x10652acd0>
files = {'content': b'2qxrA8RNuzCefclKUIjL4Ax3yupUSAeVCXzO5Y1ttyIogFCs5p30lVKTNVaAvpEHIS97vQ3EPwiRcCCBf4Ye0OE5v6ytnLj9cM0osc0o...L3C0sCjY9b5whsKKKdubY8aXriWxrJOItbcJtLWeqQEYbSGbdGCEhpQGAAgHMspykZwreYEHxjtzIjUJMMxAPf7K45JGcGp8p2R8zENFXbTwEeZbn42s4'}
def files_parameters(self, files=None):
if files is not None:
for (param_name, file_instances) in files.items():
i = 0
if file_instances is None:
continue
for file_instance in file_instances:
if file_instance is not None and not hasattr(file_instance, 'name'):
# Generate a fake name.
i += 1
> file_instance.name = f'{param_name}{i}'
E AttributeError: 'int' object has no attribute 'name'Jonathan Rosenberg
10/16/2023, 2:18 PMNiro
10/16/2023, 2:25 PMJonathan Rosenberg
10/16/2023, 4:26 PM