Skip to content

Commit 37ad0c9

Browse files
committed
Use LooseVersion
1 parent b4d33b9 commit 37ad0c9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas/io/pytables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4140,9 +4140,9 @@ def write(
41404140

41414141
if track_times is not None:
41424142
from tables import __version__ as tables_version
4143-
from packaging.version import Version
4143+
from distutils.version import LooseVersion
41444144

4145-
if Version(tables_version) >= Version("3.4.3"):
4145+
if LooseVersion(tables_version) >= LooseVersion("3.4.3"):
41464146
options["track_times"] = track_times
41474147
else:
41484148
raise ValueError(

pandas/tests/io/pytables/test_store.py

Lines changed: 1 addition & 2 deletions
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)