Skip to content
Merged
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
3 changes: 2 additions & 1 deletion skops/io/_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ def visualize(

with zf as zip_file:
schema = json.loads(zip_file.read("schema.json"))
tree = get_tree(schema, load_context=LoadContext(src=zip_file))
load_context = LoadContext(src=zip_file, protocol=schema["protocol"])
tree = get_tree(schema, load_context=load_context)

nodes = walk_tree(tree)
# TODO: it would be nice to print html representation if inside a notebook
Expand Down
4 changes: 2 additions & 2 deletions skops/io/tests/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_complex_pipeline_untrusted_set():
def test_format_object_node():
estimator = LogisticRegression(random_state=0, solver="liblinear")
state = get_state(estimator, SaveContext(None))
node = ObjectNode(state, LoadContext(None))
node = ObjectNode(state, LoadContext(None, -1))
expected = "sklearn.linear_model._logistic.LogisticRegression"
assert node.format() == expected

Expand All @@ -186,5 +186,5 @@ def test_format_object_node():
)
def test_format_json_node(inp, expected):
state = get_state(inp, SaveContext(None))
node = JsonNode(state, LoadContext(None))
node = JsonNode(state, LoadContext(None, -1))
assert node.format() == expected
2 changes: 1 addition & 1 deletion skops/io/tests/test_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def sink(nodes_iter, *args, **kwargs):
# case this test needs to be changed.
assert len(nodes_self_unsafe) == 2
assert nodes_self_unsafe[0].val == "numpy.int64"
assert nodes_self_unsafe[1].val == "test_visualize.function"
assert nodes_self_unsafe[1].val == "test_visualize.unsafe_function"

# it's not easy to test the number of indirectly unsafe nodes, because
# it will depend on the nesting structure; we can only be sure that it's
Expand Down