Hey all, I’m currently working on compatibility of...
# help
n
Hey all, I’m currently working on compatibility of
lakefs-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?
j
Hi @Nicholas Junge I’m taking a look
could you share a stack trace for the meantime?
n
i have a pytest traceback on hand, hope that works:
Copy code
self = <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'
j
thanks
n
NM misread the API name
😅 1
👈 1
😎 1
j
Thanks for the heads up@Nicholas Junge I’m opening an issue about this. I’ll ping you when it’s fixed