Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/sasctl/_services/model_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from ..core import current_session, delete, get, sasctl_command, RestObj
from .service import Service


FUNCTIONS = {
"Analytical",
"Classification",
Expand Down
14 changes: 10 additions & 4 deletions src/sasctl/pzmm/write_score_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,16 @@ def impute_missing_values(data):
"""
impute_values = \\\n + {"var1": 0, "var2": "", "var3": 125.3}
"""
self.score_code += f"\n{'':4}return data.replace(' .', np.nan).fillna(impute_values).apply(pd.to_numeric, errors='ignore')\n"
"""

return data.replace(' .', np.nan).fillna(impute_values).apply(pd.to_numeric, errors='ignore')
self.score_code += (
f"\n\n{'':4}# Specify downcasting behavior for pandas 2.x to avoid warnings\n"
+ f"{'':4}if int(pd.__version__.split('.')[0]) == 2:\n{'':8}pd.set_option('future.no_silent_downcasting', True)\n"
+ f"{'':4}return data.replace(r'^\\s*\\.$', np.nan, regex=True).fillna(impute_values).infer_objects()\n"
)
"""
# Specify downcasting behavior for pandas 2.x to avoid warnings
if int(pd.__version__.split('.')[0]) == 2:
pd.set_option('future.no_silent_downcasting', True)
return data.replace(r'^\s*\.$', np.nan, regex=True).fillna(impute_values).infer_objects()
"""

# TODO: Needs unit test
Expand Down
9 changes: 2 additions & 7 deletions tests/integration/test_pymas.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import pytest


pytest.skip(
"PyMAS functionality is deprecated and will be removed in a future release.",
allow_module_level=True,
Expand Down Expand Up @@ -241,9 +240,7 @@ def test_from_pickle(train_data, pickle_file):
end;

endpackage;
""".lstrip(
"\n"
)
""".lstrip("\n")

assert isinstance(p, PyMAS)

Expand Down Expand Up @@ -343,9 +340,7 @@ def hello_world():
end;

endpackage;
""".lstrip(
"\n"
)
""".lstrip("\n")

f = tmpdir.join("model.py")
f.write(code)
Expand Down
Loading