Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New blob_properties transport parameter for GCS #632

Merged
merged 4 commits into from Aug 18, 2021

Conversation

FHTheron
Copy link
Contributor

@FHTheron FHTheron commented Aug 1, 2021

Title

Add GCS transport parameter blob_properties to allow custom properties to be specified for newly created blobs.

Motivation

This allows setting the GCS file (or blob) content_type and content_encoding (or any other GCS blob properties) regardless of the filename. Callers can use mimetypes.guess_type or manually specify specific values.

Example:

smart_open.open("gs://somewhere/somefile.json.gz", transport_params={
  "blob_properties": {
    "content_type": "application/json",
    "content_encoding": "gzip"
  }
}

Possibly useful for #429

Checklist

  • Picked a concise, informative and complete title
  • Clearly explained the motivation behind the PR
  • Linked to any existing issues that your PR will be solving
  • Included tests for any new functionality
  • Checked that all unit tests pass

Example:
```
smart_open.open("gs://somewhere/somefile.json.gz", transport_params={
  "blob_properties": {
    "content_type": "application/json",
    "content_encoding": "gzip"
  }
}
```
@mpenkov mpenkov changed the title Pass properties to set on GCS blob. New blob_properties transport parameter for GCS Aug 18, 2021
@mpenkov mpenkov merged commit 24e0e3f into piskvorky:develop Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants