capitalone/DataProfiler

Refactor: pkg_resources will be deprecated, instead use importlib.resources

JGSweets opened this issue · 1 comments

There are currently, many instances where we use pkg_resources, but it will be deprecated. Instead, let's use importlib as suggested.

Remove it also from requirements.txt.

This exists in many labeler files and tests. Replace all usages.

Example from dataprofiler/labelers/base_data_labeler.py

# remove this
import pkg_resources

# instead use this (note that this is built-in
import importlib
# replace this
default_labeler_dir = pkg_resources.resource_filename("resources", "labelers")

# with this
default_labeler_dir = importlib.resources.files("resources").joinpath("labelers")