Skip to content

Commit ae3b692

Browse files
committed
update files to no longer depend on deprecated distutils package
1 parent a617124 commit ae3b692

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/sasctl/_services/score_execution.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import time
33
import warnings
4-
from distutils.version import StrictVersion
4+
from packaging.version import Version
55
from typing import Union
66

77
import pandas as pd
@@ -219,7 +219,7 @@ def _no_gateway_get_results(cls, server_name, library_name, table_name):
219219
Pandas Dataframe
220220
221221
"""
222-
if pd.__version__ >= StrictVersion("1.0.3"):
222+
if Version(pd.__version__) >= Version("1.0.3"):
223223
from pandas import json_normalize
224224
else:
225225
from pandas.io.json import json_normalize

‎src/sasctl/pzmm/model_parameters.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright (c) 2022, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
import json
4-
from distutils.version import StrictVersion
54
from pathlib import Path
65
from typing import Any, Optional, Tuple, Union
76

87
import pandas as pd
8+
from packaging.version import Version
99
from pandas import DataFrame
1010

1111
from .._services.model_repository import ModelRepository as mr
@@ -325,7 +325,7 @@ def get_project_kpis(
325325
missing values are replaced with pandas-valid missing values.
326326
"""
327327
# Check the pandas version for where the json_normalize function exists
328-
if pd.__version__ >= StrictVersion("1.0.3"):
328+
if Version(pd.__version__) >= Version("1.0.3"):
329329
from pandas import json_normalize
330330
else:
331331
from pandas.io.json import json_normalize

‎src/sasctl/tasks.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,12 +895,12 @@ def get_project_kpis(
895895
A pandas DataFrame representing the MM_STD_KPI table. Note that SAS
896896
missing values are replaced with pandas valid missing values.
897897
"""
898-
from distutils.version import StrictVersion
898+
from packaging.version import Version
899899

900900
from .core import is_uuid
901901

902902
# Check the pandas version for where the json_normalize function exists
903-
if pd.__version__ >= StrictVersion("1.0.3"):
903+
if Version(pd.__version__) >= Version("1.0.3"):
904904
from pandas import json_normalize
905905
else:
906906
from pandas.io.json import json_normalize

0 commit comments

Comments
 (0)