Comments (6)
Have you tried using storage_options={'project': 'myproject', 'token': 'cloud'}
in to_textfiles
?
from gcsfs.
I haven't tried that specifically, as I can't (in my case) couple storage configuration to the call to to_textfiles
. The advantage of dask's approach is that the implementation can, in principle, specify different output targets via the path alone. Accommodating a scenario where I can specify an output file as gs://my-bucket/output_dir/output.*.json
in the cloud and ~/output_dir/output.*.json
locally, without needing to modify my job code, is relatively important.
I think a small number of tweaks to the credential behavior could enable this. Would you mind if I opened a few tracking issues, with the intention of submitting a PR?
from gcsfs.
@asford , sure we of course welcome suggestions and PRs.
Note that dask does support URLs like s3's 's3://id:secret@bucket/path'
, so that could be done for gcsfs; but in general I agree that sensible defaults are a good idea too.
from gcsfs.
Would the headless
option described above be an acceptable solution? Given #56, I would envision an implementation that (in order of priority).
- Resolves default credentials via the
oauth2client
. (Ideally resolving to user credentials have been established bygsutil
or the service account.) - Resolves credentials from a cached token.
- Resolves service credentials via internal metadata.
- Falls back to unauthenticated api access.
from gcsfs.
I'm not qualified to say what a good policy is here (I don't have enough on-the-ground experience here) but just wanted to say that your engagement on this problem (and this repository generally) would be quite welcome.
from gcsfs.
@asford , after conversations, I think I agree with your order of preference, for the default case of token=None
. The options for token='cloud', token='anon' (new) and token='file'/{refresh: token} should still be respected as before.
I'll make this a separate PR which will likely conflict with the debug statements in #57
from gcsfs.
Related Issues (20)
- Stale cache info leading to failing isfile check HOT 2
- _find does not support maxdepth
- GCS High Performance Parallel Listing
- Strange behavior with `HTTPError` and multiprocessing HOT 3
- isdir/info method works incorrectly HOT 20
- Clarify how to pass JSON credentials HOT 2
- Is it needed to be so strict about dependency on fsspec HOT 1
- Release 2023.10.0 and consider relaxing fsspec dependency HOT 3
- Error when listing large directory with versions=True
- Request: add chmod
- Issues when using identity_pool.Credentials for connecting GCSFileSystem HOT 2
- Strange error message when using cp instead of put HOT 2
- Filename with slashes in the path are getting URL encoded, causing them to fail HOT 2
- Pin generation on open for version aware file system HOT 4
- asyncio exception while writing to zarr store HOT 5
- Add API reference for gcsfs.mapping to docs HOT 2
- `fs.isdir` latency 200x slower beginning with version 2023.09.01 HOT 1
- Error introduced in 2024.3.0 HOT 2
- FileNotFoundError since 2024.3.1 HOT 5
- Missing 'name' attribute in 'GCSFile' object when accessing PDF files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcsfs.