apache / apache/libcloud

Object metadata keys are lowercased when uploading to GCS

Offen
#1,530 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: storage drivers: google storage feature request stale
Vorherrschende Sprache
Python
Sterne
2.1k
Forks
931
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
4

Beschreibung

## Summary

Mixed-case metadata is lowercased when using libcloud to upload objects to Google Cloud Storage.

## Detailed Information

I'm using libcloud to upload files to a Google Cloud Storage bucket together with object metadata.
In the process, the keys in my metadata dict are being lowercased. This is not due to Google Cloud Storage, which does support mixed case metadata.

The issue can be reproduced following the example from the docs:
```
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver

cls = get_driver(Provider.GOOGLE_STORAGE)
driver = cls('SA-EMAIL', './SA.json') # provide service account credentials here

FILE_PATH = '/home/user/file'

extra = {'meta_data': {'camelCase': 'foo'}}

# Upload with metadata
with open(FILE_PATH, 'rb') as iterator:
obj = driver.upload_object_via_stream(iterator=iterator,
container=container,
object_name='file',
extra=extra)
```
The file uploads succesfully, but resulting metadata will look as follows:
![image](https://user-images.githubusercontent.com/25384180/102534327-dd828780-40a6-11eb-999a-ae3d775c3786.png)

Where `camelCase` has been turned into `camelcase`.

I'm using apache-libcloud==3.0.0 with Python 3.8 on Linux (the python:3.8 Docker image).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne beim Einstiegspunkt upload_object_via_stream und verfolge, wie das zusätzliche Metadaten-Dictionary für Google Cloud Storage vorbereitet wird. Reproduziere das Beispiel mit dem camelCase-Schlüssel und überprüfe anschließend, dass die Metadaten des hochgeladenen Objekts ihre ursprüngliche Groß-/Kleinschreibung beibehalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
google-cloud, python
Bereich
cloud
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.