[PR #1361] [MERGED] Updated python example #1421

Closed
opened 2026-03-03 12:34:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/1361
Author: @j-antunes
Created: 10/12/2023
Status: Merged
Merged: 11/1/2023
Merged by: @fsouza

Base: mainHead: main


📝 Commits (4)

  • 5bb8b4b Updated python example
  • 5d37c28 Addressed PR comments
  • 5a45b09 Use os.environ.setdefault
  • 61fbd9c examples/python: remove reference to requirements.in

📊 Changes

1 file changed (+22 additions, -0 deletions)

View changed files

📝 examples/python/python.py (+22 -0)

📄 Description

I tried the python example and it is not working out of the box. The main issue that I was facing is:

google.api_core.exceptions.BadRequest: 400 GET https://storage.googleapis.com/storage/v1/b?project=test&projection=noAcl&prettyPrint=false: Invalid project number: 0. Project id: 0 is invalid or not found

I think the issue has to do with not setting the api_endpoint for the docker container.

The solution is to add

    client_options={"api_endpoint": "http://localhost:4443"},

Apart from that I added some instructions as to how to run this example.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/1361 **Author:** [@j-antunes](https://github.com/j-antunes) **Created:** 10/12/2023 **Status:** ✅ Merged **Merged:** 11/1/2023 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`5bb8b4b`](https://github.com/fsouza/fake-gcs-server/commit/5bb8b4bd58a170eee7454dbfade04dfdaf561ae2) Updated python example - [`5d37c28`](https://github.com/fsouza/fake-gcs-server/commit/5d37c28262cdae5aa2a92090825f1524515e3d1b) Addressed PR comments - [`5a45b09`](https://github.com/fsouza/fake-gcs-server/commit/5a45b09a6e630361b7951f0dfdf69bcd165b2a43) Use `os.environ.setdefault` - [`61fbd9c`](https://github.com/fsouza/fake-gcs-server/commit/61fbd9cf9b812222935bcacfc4645a87cca69e2d) examples/python: remove reference to requirements.in ### 📊 Changes **1 file changed** (+22 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `examples/python/python.py` (+22 -0) </details> ### 📄 Description I tried the python example and it is not working out of the box. The main issue that I was facing is: ``` google.api_core.exceptions.BadRequest: 400 GET https://storage.googleapis.com/storage/v1/b?project=test&projection=noAcl&prettyPrint=false: Invalid project number: 0. Project id: 0 is invalid or not found ``` I think the issue has to do with not setting the `api_endpoint` for the docker container. The solution is to add ``` client_options={"api_endpoint": "http://localhost:4443"}, ``` Apart from that I added some instructions as to how to run this example. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:34:31 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#1421
No description provided.