Skip to content

Commit 4d304df

Browse files
committed
Release version 2.6.3
1 parent 32ae6e9 commit 4d304df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1432
-250
lines changed

ads/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ def set_auth(
5757
global oci_config_path
5858
global oci_key_profile
5959
oci_key_profile = profile
60-
if os.path.exists(os.path.expanduser(oci_config_location)):
61-
oci_config_path = oci_config_location
62-
else:
63-
logging.warning(
64-
f"{oci_config_location} file not exists, default value oci.config.DEFAULT_LOCATION used instead"
65-
)
66-
oci_config_path = oci.config.DEFAULT_LOCATION
60+
6761
if auth == "api_key":
6862
resource_principal_mode = False
63+
if os.path.exists(os.path.expanduser(oci_config_location)):
64+
oci_config_path = oci_config_location
65+
else:
66+
logging.warning(
67+
f"{oci_config_location} file not exists, default value oci.config.DEFAULT_LOCATION used instead"
68+
)
69+
oci_config_path = oci.config.DEFAULT_LOCATION
6970
elif auth == "resource_principal":
7071
resource_principal_mode = True
7172

ads/ads_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "2.6.2"
2+
"version": "2.6.3"
33
}

ads/common/model_export_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def prepare_generic_model(
148148
>>>
149149
>>> ads.set_auth('api_key', oci_config_location=oci.config.DEFAULT_LOCATION, profile='DEFAULT')
150150
>>> model_artifact_location = os.path.expanduser('~/myusecase/model/')
151-
>>> inference_conda_env="oci://my-bucket@namespace/conda_environments/cpu/Data Exploration and Manipulation for CPU Python 3.7/2.0/dataexpl_p37_cpu_v2"
151+
>>> inference_conda_env="oci://my-bucket@namespace/conda_environments/cpu/Data_Exploration_and_Manipulation_for_CPU_Python_3.7/2.0/dataexpl_p37_cpu_v2"
152152
>>> inference_python_version = "3.7"
153153
>>> if not os.path.exists(model_artifact_location):
154154
... os.makedirs(model_artifact_location)

ads/common/model_introspect.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,13 @@ def _prepare_result(self) -> List[PrintItem]:
260260
for key, item in self._result.items():
261261
error_msg = (
262262
item.get(_TEST_COLUMNS.ERROR_MSG)
263-
if item.get(_TEST_COLUMNS.SUCCESS) == False
263+
if (
264+
item.get(_TEST_COLUMNS.SUCCESS) == False
265+
or (
266+
item.get(_TEST_COLUMNS.SUCCESS) == None
267+
and "WARNING" in item.get(_TEST_COLUMNS.ERROR_MSG, "")
268+
)
269+
)
264270
else ""
265271
)
266272
result.append(

ads/common/utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,11 @@ class FileOverwriteError(Exception):
9292
pass
9393

9494

95-
# get number of core count
96-
@runtime_dependency(module="psutil", install_from=OptionalDependency.VIZ)
9795
def get_cpu_count():
9896
"""
9997
Returns the number of CPUs available on this machine
10098
"""
101-
return psutil.cpu_count()
99+
return os.cpu_count()
102100

103101

104102
@deprecated(
@@ -1119,13 +1117,12 @@ def _serialize_input_helper(
11191117
data = data.tolist()
11201118
elif isinstance(data, pd.core.frame.DataFrame):
11211119
data = data.to_json()
1122-
elif isinstance(data, bytes):
1123-
data = base64.b64encode(data).decode("utf-8")
11241120
elif (
11251121
isinstance(data, dict)
11261122
or isinstance(data, str)
11271123
or isinstance(data, list)
11281124
or isinstance(data, tuple)
1125+
or isinstance(data, bytes)
11291126
):
11301127
pass
11311128
else:

ads/dataflow/dataflow.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
runtime_dependency,
2626
OptionalDependency,
2727
)
28+
from ads.common.decorator.deprecate import deprecated
2829

2930
from oci.data_flow.models import (
3031
CreateApplicationDetails,
@@ -60,6 +61,7 @@ class SPARK_VERSION(str):
6061

6162

6263
class DataFlow:
64+
@deprecated("2.6.3")
6365
def __init__(
6466
self,
6567
compartment_id=None,
@@ -947,6 +949,7 @@ def load_app(
947949

948950

949951
class DataFlowApp(DataFlow):
952+
@deprecated("2.6.3")
950953
def __init__(self, app_config, app_response, app_dir, oci_link, **kwargs):
951954
super().__init__(compartment_id=app_config["compartment_id"], **kwargs)
952955
self._config = app_config
@@ -1386,6 +1389,7 @@ def get_run(self, run_id: str):
13861389

13871390

13881391
class RunObserver:
1392+
@deprecated("2.6.3")
13891393
def __init__(self, app, run_config, save_log_to_local):
13901394
self.app = app
13911395
self._config = run_config
@@ -1571,6 +1575,7 @@ def oci_link(self) -> object:
15711575
class DataFlowRun(DataFlow):
15721576
LOG_OUTPUTS = ["stdout", "stderr"]
15731577

1578+
@deprecated("2.6.3")
15741579
def __init__(
15751580
self, run_config, run_response, save_log_to_local, local_dir, **kwargs
15761581
):
@@ -1739,6 +1744,7 @@ def _repr_html_(self):
17391744

17401745

17411746
class DataFlowLog:
1747+
@deprecated("2.6.3")
17421748
def __init__(self, text, oci_path, log_local_dir):
17431749
self.text = str(text)
17441750
self._oci_path = oci_path

ads/dataflow/dataflowsummary.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
from pandas import DataFrame
1313
import pandas as pd
1414
from abc import ABCMeta
15+
from ads.common.decorator.deprecate import deprecated
1516

1617

1718
class SummaryList(list, metaclass=ABCMeta):
19+
@deprecated("2.6.3")
1820
def __init__(self, entity_list, datetime_format=utils.date_format):
1921
if isinstance(entity_list, filter):
2022
entity_list = list(entity_list)

ads/hpo/search_cv.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import multiprocessing
99
import os
1010
import uuid
11+
import psutil
1112
from enum import Enum, auto
1213
from time import time, sleep
1314

@@ -614,7 +615,6 @@ def _init_data(self, X, y):
614615
self.X = X
615616
self.y = y
616617

617-
@runtime_dependency(module="psutil", install_from=OptionalDependency.VIZ)
618618
def halt(self):
619619
"""
620620
Halt the current running tuning process.
@@ -656,7 +656,6 @@ def halt(self):
656656
"No running process found. Do you need to call tune()?"
657657
)
658658

659-
@runtime_dependency(module="psutil", install_from=OptionalDependency.VIZ)
660659
def resume(self):
661660
"""
662661
Resume the current halted tuning process.

ads/jobs/builders/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010

1111
class Builder(Serializable):
12+
13+
attribute_map = {}
14+
1215
def __init__(self, spec: Dict = None, **kwargs) -> None:
1316
"""Initialize the object with specifications.
1417
@@ -25,9 +28,20 @@ def __init__(self, spec: Dict = None, **kwargs) -> None:
2528
super().__init__()
2629
if spec is None:
2730
spec = {}
31+
spec = self._standardize_spec(spec)
32+
kwargs = self._standardize_spec(kwargs)
2833
spec.update(kwargs)
2934
self._spec = spec
3035

36+
def _standardize_spec(self, spec):
37+
if not spec:
38+
return {}
39+
snake_to_camel_map = {v: k for k, v in self.attribute_map.items()}
40+
for key in list(spec.keys()):
41+
if key not in self.attribute_map and key in snake_to_camel_map:
42+
spec[snake_to_camel_map[key]] = spec.pop(key)
43+
return spec
44+
3145
def set_spec(self, k: str, v: Any):
3246
"""Sets a specification property for the object.
3347

0 commit comments

Comments
 (0)