Skip to content

Commit

Permalink
Replaced deprecated python LooseVersion function
Browse files Browse the repository at this point in the history
  • Loading branch information
kovdb75 committed Jun 3, 2024
1 parent d671416 commit 92b69d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/python/partitioning_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import time
import unittest

from distutils.version import LooseVersion
from packaging.version import Version
from testgres import get_new_node, get_pg_version, configure_testgres

# set setup base logging config, it can be turned on by `use_python_logging`
Expand Down Expand Up @@ -58,7 +58,7 @@
}

logging.config.dictConfig(LOG_CONFIG)
version = LooseVersion(get_pg_version())
version = Version(get_pg_version())


# Helper function for json equality
Expand Down Expand Up @@ -448,7 +448,7 @@ def test_parallel_nodes(self):

# Check version of postgres server
# If version < 9.6 skip all tests for parallel queries
if version < LooseVersion('9.6.0'):
if version < Version('9.6.0'):
return

# Prepare test database
Expand Down Expand Up @@ -485,7 +485,7 @@ def test_parallel_nodes(self):
# Test parallel select
with node.connect() as con:
con.execute('set max_parallel_workers_per_gather = 2')
if version >= LooseVersion('10'):
if version >= Version('10'):
con.execute('set min_parallel_table_scan_size = 0')
else:
con.execute('set min_parallel_relation_size = 0')
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def test_update_node_plan1(self):
self.assertEqual(len(plan["Target Tables"]), 11)

# Plan was seriously changed in vanilla since v14
if version < LooseVersion('14'):
if version < Version('14'):
expected_format = '''
{
"Plans": [
Expand Down

0 comments on commit 92b69d8

Please sign in to comment.