Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with version saving being overwritten on subsequent saves #481

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

jklaise
Copy link
Contributor

@jklaise jklaise commented Sep 17, 2021

Fixes the issue found in SeldonIO/alibi-detect#236 (comment).

@jklaise jklaise requested a review from ascillitoe September 17, 2021 13:51
@@ -22,6 +22,7 @@ def default_meta() -> dict:
"type": [],
"explanations": [],
"params": {},
"version": None,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not strictly necessary here but added it as it serves as a kind of high-level "schema".

self.meta["name"] = self.__class__.__name__
self.meta["version"] = __version__
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version needs to be added here instead of in the default_meta because each explainer has it's own DEFAULT_META defined in api.defaults.

@codecov
Copy link

codecov bot commented Sep 17, 2021

Codecov Report

Merging #481 (a4e75b7) into master (90ff57e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #481      +/-   ##
==========================================
- Coverage   82.32%   82.32%   -0.01%     
==========================================
  Files          76       76              
  Lines       10316    10315       -1     
==========================================
- Hits         8493     8492       -1     
  Misses       1823     1823              
Impacted Files Coverage Δ
alibi/api/defaults.py 100.00% <ø> (ø)
alibi/saving.py 88.57% <ø> (-0.06%) ⬇️
alibi/api/interfaces.py 90.47% <100.00%> (ø)

Copy link
Contributor

@ascillitoe ascillitoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jklaise I just tested this and it seems to work nicely i.e. not overwriting with runtime version, but still raising a warning (which is preferable in my opinion) instead of an exception.

@ascillitoe ascillitoe merged commit 77f80e0 into SeldonIO:master Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants