Skip to content

Add type hints to public functions in pystore/utils.py #104

@ranaroussi

Description

@ranaroussi

Goal

The public utility functions in pystore/utils.py currently lack PEP 484 type annotations. Add type hints to all public functions in the file.

Acceptance criteria

  • Add type annotations to the parameters and return types of all public functions in pystore/utils.py:
    • read_csv(urlpath, *args, **kwargs)
    • datetime_to_int64(df)
    • subdirs(d)
    • path_exists(path)
    • read_metadata(path)
    • write_metadata(path, metadata={})
    • make_path(*args)
    • get_path(*args)
    • set_path(path)
    • list_stores()
    • delete_store(store)
    • delete_stores()
    • set_client(scheduler=None)
    • get_client()
    • set_partition_size(size=None)
    • get_partition_size()
    • configure_logging(level=logging.INFO, format_string=None)
  • Use pathlib.Path for path-typed args/returns where appropriate.
  • Use pd.DataFrame (or dd.DataFrame for Dask) for dataframe types.
  • Use Optional[X], Union[X, Y], Dict, List, Set from typing as needed (Python 3.7-compatible).
  • Add a from typing import ... import line near the top of the file.
  • Function bodies remain unchanged — annotations only.

Out of scope

  • Type hints on private functions (anything starting with _)
  • Refactoring or behavior changes
  • Other files in the package

Verification

  • python -c "import pystore.utils; help(pystore.utils.set_path)" should show typed signature
  • Existing tests still pass: pytest tests/
  • Optional: mypy pystore/utils.py should not introduce regressions (it may already report unrelated issues — those are not part of this task)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpythonPull requests that update python code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions