From 62eb2213b0bd934373012924c466317769cc8e16 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Mon, 17 Jun 2024 16:32:02 +0100 Subject: [PATCH] Use warnings.warn for import rust extension failure --- artistools/estimators/estimators.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/artistools/estimators/estimators.py b/artistools/estimators/estimators.py index c0125143e..8469c0409 100755 --- a/artistools/estimators/estimators.py +++ b/artistools/estimators/estimators.py @@ -11,6 +11,7 @@ import tempfile import time import typing as t +import warnings from collections import namedtuple from pathlib import Path @@ -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( diff --git a/requirements.txt b/requirements.txt index 800903268..d4ceb7510 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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