RDBC-1029/1030 Fix bulk insert error detection and Enum dict key serialisation#273
Open
redknightlois wants to merge 2 commits intoravendb:v7.1from
Open
RDBC-1029/1030 Fix bulk insert error detection and Enum dict key serialisation#273redknightlois wants to merge 2 commits intoravendb:v7.1from
redknightlois wants to merge 2 commits intoravendb:v7.1from
Conversation
…tion result['$type'].starts_with(...) is not a Python method; the correct name is str.startswith(). The typo swallowed all server-side bulk insert errors with an AttributeError, hiding the real cause. Regression test: test_bulk_insert_error_handling.py verifies that a server-side abort surfaces as BulkInsertAbortedException with the server's error detail rather than the generic "Failed to execute bulk insert" message.
json.dumps raises TypeError for non-string dict keys. Entities whose fields are dicts with Enum keys (e.g. {CheckType.ENGINE: CheckStatus.GOOD}) failed at session.store() time. Fix: wrap default_method to recursively convert Enum keys to their .value before json.dumps sees them.
Regression test: test_store_enum_key_dict.py verifies that an entity with an Enum-keyed dict field stores and round-trips correctly.
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.
Issue link
https://issues.hibernatingrhinos.com/issue/RDBC-1029
https://issues.hibernatingrhinos.com/issue/RDBC-1030
Additional description
RDBC-1029 –
BulkInsert._get_exception_from_operationcalled the non-existentstr.starts_withmethod (Python hasstr.startswith), raisingAttributeErroron any bulk-insert server error. Fixed the typo.RDBC-1030 –
Utils.entity_to_dictpassed a dict withEnumkeys directly tojson.dumps, which raisesTypeErrorbecauseEnuminstances are not JSON-serialisable as keys. Fixed by recursively normalisingEnumkeys to their.valuebefore serialisation.Type of change
How risky is the change?
Backward compatibility
Is it platform specific issue?
Documentation update
Documentation Requiredtag.Testing by Contributor
private)Testing by RavenDB QA team
QA Requiredtag.Is there any existing behavior change of other features due to this change?
UI work
Studio Requiredtag.