Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Detect pandas availability to select serializer #2300

Merged
merged 5 commits into from Jun 16, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions snakemake/persistence.py
Expand Up @@ -35,10 +35,12 @@ def __init__(
shadow_prefix=None,
warn_only=False,
):
try:
self._serialize_param = self._serialize_param_pandas
except ModuleNotFoundError:
self._serialize_param = self._serialize_param_builtin
import importlib.util
self._serialize_param = (
self._serialize_param_pandas
if importlib.util.find_spec("pandas") is not None
else self._serialize_param_builtin
)

self._max_len = None

Expand Down