-
Notifications
You must be signed in to change notification settings - Fork 164
✨ Support alternative GCP Universes #732
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
Merged
martindurant
merged 6 commits into
fsspec:main
from
elafarge:elafarge/support-other-gcp-universes
Jan 5, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
906b067
✨ Support alternative GCP Universes
elafarge 22df853
Fix typo, fix tests on CI & require a version of google-auth that sup…
elafarge cb7d8ca
Fix tests
elafarge 1700340
update docs
elafarge 82665e0
add order of precedence to docs
elafarge 357dc6a
relax google auth requirement constraint
elafarge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,6 +108,10 @@ def close(self): | |
| self.seek(0) | ||
|
|
||
|
|
||
| def _gcp_universe_domain(): | ||
| return os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN", "googleapis.com") | ||
|
|
||
|
|
||
| def _location(): | ||
| """ | ||
| Resolves GCS HTTP location as http[s]://host | ||
|
|
@@ -125,7 +129,8 @@ def _location(): | |
| ): | ||
| _emulator_location = f"http://{_emulator_location}" | ||
| return _emulator_location | ||
| return "https://storage.googleapis.com" | ||
|
|
||
| return f"https://storage.{_gcp_universe_domain()}" | ||
martindurant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| def _chunks(lst, n): | ||
|
|
@@ -346,6 +351,10 @@ def _location(self): | |
| def base(self): | ||
| return f"{self._location}/storage/v1/" | ||
|
|
||
| @property | ||
| def batch_url_base(self): | ||
| return f"{self._location}/batch/storage/v1" | ||
|
|
||
| @property | ||
| def project(self): | ||
| return self.credentials.project | ||
|
|
@@ -1300,7 +1309,7 @@ async def _rm_files(self, paths): | |
| body = "".join(parts) | ||
| headers, content = await self._call( | ||
| "POST", | ||
| f"{self._location}/batch/storage/v1", | ||
| self.batch_url_base, | ||
| headers={ | ||
| "Content-Type": 'multipart/mixed; boundary="==========' | ||
| '=====7330845974216740156=="' | ||
|
|
@@ -1339,7 +1348,7 @@ async def _rm_files(self, paths): | |
|
|
||
| @property | ||
| def on_google(self): | ||
| return "torage.googleapis.com" in self._location | ||
| return f"torage.{_gcp_universe_domain()}" in self._location | ||
|
Comment on lines
1341
to
+1351
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically it's now "on google-like" :) |
||
|
|
||
| async def _rm(self, path, recursive=False, maxdepth=None, batchsize=20): | ||
| paths = await self._expand_path(path, recursive=recursive, maxdepth=maxdepth) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.