Skip to content

Commit

Permalink
Use warnings.warn for import rust extension failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Jun 17, 2024
1 parent f4013d2 commit 62eb221
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion artistools/estimators/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import tempfile
import time
import typing as t
import warnings
from collections import namedtuple
from pathlib import Path

Expand Down Expand Up @@ -250,7 +251,7 @@ def get_rankbatch_parquetfile(
try:
from artistools.rustext import estimparse as rustestimparse
except ImportError:
print("WARNING: Rust extension not available. Falling back to slow python reader.")
warnings.warn("WARNING: Rust extension not available. Falling back to slow python reader.", stacklevel=2)
use_rust = False

print(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ matplotlib>=3.9.0
mypy>=1.10.0
numexpr>=2.10.0
numpy>=1.26.0
pandas[compression,parquet,pyarrow]>=2.2.2
pandas[compression,parquet]>=2.2.2
polars==0.20.31
pre-commit>=3.7.1
pyarrow>=16.1.0
Expand Down

0 comments on commit 62eb221

Please sign in to comment.