Skip to content

Commit

Permalink
[DBACLD-47417] Remove unused inspect_pickle_version
Browse files Browse the repository at this point in the history
  • Loading branch information
ke li authored and ke li committed Jan 19, 2023
1 parent 6de1e39 commit 087f8dd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
4 changes: 0 additions & 4 deletions ops-implementations/ads-ml-service/app/runtime/inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,3 @@ def inspect_pmml_model_name(model_file: bytes) -> typing.Optional[str]:
def inspect_pmml_subtype(model_file: bytes) -> typing.Optional[str]:
wrapper = load_pmml_model(model_file).loaded_model
return wrapper.model.modelElement


def inspect_pickle_version(model_file: bytes) -> int:
return max(op[0].proto for op in pickletools.genops(model_file))
1 change: 0 additions & 1 deletion ops-implementations/ads-ml-service/app/schemas/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import enum
import typing
import typing_extensions
import datetime as dt

import numpy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,6 @@ def test_pmml_output_schema_inspection(
}


def test_inspect_pickle_version():
# Arrange
p0 = pickle.dumps('test_0', protocol=0)
p1 = pickle.dumps('test_1', protocol=1)
p2 = pickle.dumps('test_2', protocol=2)
p3 = pickle.dumps(str.encode('test_3'), protocol=3)
p4 = pickle.dumps('test_4', protocol=4)

# When
ver_0 = app_signature_inspection.inspect_pickle_version(p0)
ver_1 = app_signature_inspection.inspect_pickle_version(p1)
ver_2 = app_signature_inspection.inspect_pickle_version(p2)
ver_3 = app_signature_inspection.inspect_pickle_version(p3)
ver_4 = app_signature_inspection.inspect_pickle_version(p4)

# Assert
assert ver_0 == 0
assert ver_1 == 1
assert ver_2 == 2
assert ver_3 == 3
assert ver_4 == 4


def test_inspect_pmml_subtype():
# When
sub_type_regression = app_signature_inspection.inspect_pmml_subtype(
Expand Down

0 comments on commit 087f8dd

Please sign in to comment.