Repository navigation
Raise ValueError in model.load_mmm() for proto and unpicklable files. - #2006
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
Passing a `.binpb` protobuf model saved by `meridian_serde.save_meridian()` to the deprecated `model.load_mmm()` function previously failed inside `joblib.load()` with an opaque `KeyError: 10` because binary `MmmKernel` protobufs start with wire tag `0x0a` (decimal `10`). Check for `.binpb`, `.txtpb`, and `.textproto` suffixes (case-insensitive) upfront in `model.load_mmm()` and catch `(pickle.UnpicklingError, KeyError, EOFError)` around `joblib.load()`, raising a descriptive `ValueError` (chained with `from e`) directing users to `meridian.schema.serde.meridian_serde.load_meridian()`. PiperOrigin-RevId: 1020145973
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raise ValueError in model.load_mmm() for proto and unpicklable files.
Passing a
.binpbprotobuf model saved bymeridian_serde.save_meridian()to the deprecatedmodel.load_mmm()function previously failed insidejoblib.load()with an opaqueKeyError: 10because binaryMmmKernelprotobufs start with wire tag0x0a(decimal10).Check for
.binpb,.txtpb, and.textprotosuffixes (case-insensitive) upfront inmodel.load_mmm()and catch(pickle.UnpicklingError, KeyError, EOFError)aroundjoblib.load(), raising a descriptiveValueError(chained withfrom e) directing users tomeridian.schema.serde.meridian_serde.load_meridian().