Hello there! I am playing around with the quicksta...
# help
j
Hello there! I am playing around with the quickstart and was trying to figure out how to add object-level metadata to files uploaded from a local filesystem. I understand that I can add arbitrary key-value pairs as part of a commit, but what about object information? Is there any way to do this with lakefs? As an example, here's a file uploaded from my local filesystem and the "Object Information" as it exists within LakeFS. How do I add key-value pairs to this object? Thank you!
i
you can add metadata when using the s3 gateway, with the
--metadata
option (when using the cli). adding metadata from the lakeFS WebUI is currently not supported.
j
Is it supported in any way? Is there any way to add arbitrary key-value metadata on a per-object basis without S3?
i
afaik, adding
x-lakefs-meta-<your-tag>
header (with a value of your choice) to the lakeFS API upload-object endpoint should do the work. though it needs validation…
j
Can you please point me to documentation of this header and some examples so I can try a simple curl request to see if it works as expected?
o
You can also do it using the Python SDK:
Copy code
(lakefs.repository('my-repo')
    .branch('main')
    .object('my-file.txt')
    .upload(
        data='some content', 
        metadata={
            'is-sensitive': 'false',
        }
    )
)
I agree the documentation on this is currently lacking.