-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing for streaming of objects more stable (#1031)
We penalize objects that are throwing away data by picking default values. For example, during parsing of complex objects, we sometimes prefer an empty object of default values, but instead we can prefer something else. This also works for handling bad union disambiguation. <!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Improve object streaming stability by refining default value handling in deserialization and enhancing logging and tests. > > - **Behavior**: > - Modify `pick_best()` in `array_helper.rs` to penalize default values like null or empty lists when selecting best values. > - Add handling for `BamlValueWithFlags::Class` to check for default flags in properties. > - **Logging**: > - Replace `println!` with `log::info!` in `macros.rs` for better logging control. > - Add `log::trace!` for score logging in `macros.rs`. > - **Tests**: > - Add `test_partial_choppy` in `test_partials.rs` to test partial deserialization with incomplete data. > - Update `test_partial_deserializer!` macro in `macros.rs` to include score logging. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 916851c. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
3 changed files
with
215 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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