Open jbsilva opened 6 months ago
Writing metadata containing _ is ignored without warnings.
_
More appropriate options would be:
.getxattr()
.replace("_", "-")
-
file_bytes = b'My file...' metadata = {"deviceId": 'LM1', 'device_serial': 'A1234', 'device-name': 'My device'} fs= S3FileSystem() fs.pipe_file("bucket/key", file_bytes, Metadata=metadata) fs.metadata("bucket/key") >> {'deviceid': 'LM1', 'device-name': 'My device'}
As you can see, the device_serial metadata was not written.
device_serial
I can confirm this by looking in the S3 bucket or with boto3:
import boto3 s3_client = boto3.client('s3') s3_client.head_object(Bucket="bucket", Key="key")["Metadata"] >> {'deviceid': 'LM1', 'device-name': 'My device'}
Can you make PR to allow these keys, if you know how? I assume getxattr would need to be changed.
Writing metadata containing
_
is ignored without warnings.More appropriate options would be:
.getxattr()
can't get them, as it performs a.replace("_", "-")
)-
As you can see, the
device_serial
metadata was not written.I can confirm this by looking in the S3 bucket or with boto3: