Code Monkey home page Code Monkey logo

Comments (6)

martindurant avatar martindurant commented on June 3, 2024

Have you tried using storage_options={'project': 'myproject', 'token': 'cloud'} in to_textfiles?

from gcsfs.

asford avatar asford commented on June 3, 2024

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.

martindurant avatar martindurant commented on June 3, 2024

@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.

asford avatar asford commented on June 3, 2024

Would the headless option described above be an acceptable solution? Given #56, I would envision an implementation that (in order of priority).

  1. Resolves default credentials via the oauth2client. (Ideally resolving to user credentials have been established by gsutil or the service account.)
  2. Resolves credentials from a cached token.
  3. Resolves service credentials via internal metadata.
  4. Falls back to unauthenticated api access.

from gcsfs.

mrocklin avatar mrocklin commented on June 3, 2024

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.

martindurant avatar martindurant commented on June 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.