Giter Site home page Giter Site logo

Comments (6)

janjagusch avatar janjagusch commented on August 17, 2024

Having looked at the code more thoroughly, I think we should:

  1. Add integration tests for get_store_from_url
  2. Add a classmethod from_url(cls, url: str) -> ""KeyValueStore" to the definition of KeyValueStore. Alternatively, we could add a classmethod from_parsed_url(cls, scheme, host, port, path, query, userinfo) -> "KeyValueStore", similar to extract_params.
  3. get_store_from_url then only looks up the schema and delegates the rest of the logic to from_(parsed)_url
  4. Finally, we mirror what fsspec does and allow registering additional stores. Registration would happen through an entry point in the setup.py.

Apart from now being able to register additional stores, this should also clean up _urls.py, _get_store.py, _store_creation.py, and _store_decoration.py.

FYI: @SimonBohnenQC

from minimalkv.

simonbohnen avatar simonbohnen commented on August 17, 2024

This concept sounds much better than the current structure 👍🏼

As authentication was an issue in #51, I would suggest testing get_store_from_url against live AWS / GCS. Can we provide credentials as GitHub secrets to do this @janjagusch?

from minimalkv.

simonbohnen avatar simonbohnen commented on August 17, 2024

We would probably not be using create_store, url2dict, and get_store internally anymore. We should probably still keep them available, right? Deprecating them seems like the best choice.

from minimalkv.

xhochy avatar xhochy commented on August 17, 2024

I would love to keep create_store as this gives a way to pass parameters where there can also be more schema validation upfront. A typical use case is to have the store configuration in a JSON/YAML and then use create_store(json.load(…)).

from minimalkv.

simonbohnen avatar simonbohnen commented on August 17, 2024

I would love to keep create_store as this gives a way to pass parameters where there can also be more schema validation upfront. A typical use case is to have the store configuration in a JSON/YAML and then use create_store(json.load(…)).

I see the point of creating stores only from str or int parameters. I would also prefer if store objects could be created without relying on an internet connection or successful authentication. Thus, I'd like to move e.g. the create_store_azure code to a constructor for the AzureBlockBlobStore class.

What do you mean by "schema validation" in this context?

from minimalkv.

xhochy avatar xhochy commented on August 17, 2024

With "schema validation", I mean that you can specify a type schema for JSON/YAML files and validate that they have the correct values before creating the stores themselves. This has been useful in the past in using the stores in some settings to check whether the configuration is valid before deploying it to production.

from minimalkv.

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.