Skip to content

Commit 4daff82

Browse files
rbenesradekbenesinno
authored andcommitted
Use LooseVersion
1 parent 8fff497 commit 4daff82

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/io/pytables.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4147,9 +4147,9 @@ def write(
41474147

41484148
if track_times is not None:
41494149
from tables import __version__ as tables_version
4150-
from packaging.version import Version
4150+
from distutils.version import LooseVersion
41514151

4152-
if Version(tables_version) >= Version("3.4.3"):
4152+
if LooseVersion(tables_version) >= LooseVersion("3.4.3"):
41534153
options["track_times"] = track_times
41544154
else:
41554155
raise ValueError(

pandas/tests/io/pytables/test_store.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ def test_no_track_times(self, setup_path):
304304
import hashlib
305305
import time
306306
import tables
307-
from packaging.version import Version
308307

309308
def checksum(filename, hash_factory=hashlib.md5, chunk_num_blocks=128):
310309
h = hash_factory()
@@ -329,7 +328,7 @@ def create_h5_and_return_checksum(track_times):
329328

330329
return checksum(path)
331330

332-
if Version(tables.__version__) < Version("3.4.3"):
331+
if LooseVersion(tables.__version__) < LooseVersion("3.4.3"):
333332
with pytest.raises(
334333
ValueError,
335334
match="You cannot set track_times with table version < 3.4.3",

0 commit comments

Comments
 (0)