Repository navigation
Release 3.2.1: records.update sends its fields under data - #30
Merged
Merged
Conversation
records.update(target, data, label=) sent PATCH /records/{id} with the
fields at the top level of the body. RushDB Cloud reads a record write as
{label, data, options} (or {label, properties: [...]}), as the JavaScript
SDK and records.set send it, so it ignored the update, or answered 500
without a label. update now sends {"label": ..., "data": {...}}.
Direct mode read the flat body too, which hid the bug. Its record writes
now take data or a properties list, as Cloud does, and refuse anything
else with 400; a field named label, options or data stays a field.
Fixes #29
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.
records.update(target, data, label=)sentPATCH /records/{id}with the fields at the top level of the body. RushDB Cloud reads a record write as{label, data, options}(or{label, properties: [...]}), the shape the JavaScript SDK sends forrecords.updateand this SDK sends forrecords.set. Cloud therefore ignored the update, or answered 500 without a label (seen in rush-db/langchain-rushdb CI).records.updatenow sends{"label": ..., "data": {...}}. The public signature is unchanged.POST /records,PUT/PATCH /records/{id}) now takedataor apropertieslist, as Cloud does, and refuse anything else with 400. A field namedlabel,optionsordatais stored as a field instead of being dropped.Tests:
tests/test_records_write_body.py: the bodyupdateandsetsend to Cloud.tests/test_direct_mode.py: update merges thedataobject, a flat body is refused, property drafts are written.tests/test_direct_mode_live.py: update with a label and a field namedlabelagainst a real engine (rushdb/rushdb:3.0.4). It fails without the fix.Version 3.2.1 (patch). After merge, publish the GitHub release
v3.2.1to upload to PyPI.Fixes #29