Skip to content

get_store_from_url triggers DeprecationWarning from its own internal create_store call #222

@lorey

Description

@lorey

Description

get_store_from_url internally calls create_store (in _get_store.py:232), which unconditionally emits a DeprecationWarning telling users to use get_store_from_url instead:

create_store will be removed in the next major release.
If you want to create a KeyValueStore from a URL, use get_store_from_url.

This means users following the recommended API still get deprecation warnings they cannot avoid.

Reproduction

import warnings
warnings.simplefilter("always")
from minimalkv import get_store_from_url
store = get_store_from_url("memory://")
print("store:", type(store).__name__)

Output (minimalkv 1.11.2, Python 3.12.7):

minimalkv/_hstores.py:11: DeprecationWarning: This class will be renamed to `Boto3Store` in the next major release.
  from minimalkv.net.s3fsstore import S3FSStore
minimalkv/_get_store.py:232: DeprecationWarning:
        create_store will be removed in the next major release.
        If you want to create a KeyValueStore from a URL, use get_store_from_url.

  store = create_store(type, params)
store: DictStore

Same for hfs://:

minimalkv/_hstores.py:11: DeprecationWarning: This class will be renamed to `Boto3Store` in the next major release.
  from minimalkv.net.s3fsstore import S3FSStore
minimalkv/_get_store.py:232: DeprecationWarning:
        create_store will be removed in the next major release.
        If you want to create a KeyValueStore from a URL, use get_store_from_url.

  store = create_store(type, params)
store: HFilesystemStore

Expected behavior

get_store_from_url should not trigger deprecation warnings since it is the recommended replacement.

Potential fix

get_store_from_url could list all available classes in scheme_to_store? https://github.com/data-engineering-collective/minimalkv/blob/5e627338792d6879725eb220fca2029c4ccf44a8/minimalkv/_get_store.py#L58C5-L58C20

Version

minimalkv 1.11.2, Python 3.12.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions