Skip to content

Tests and updates for addition/deletion of metadata labels#3354

Merged
rtibbles merged 1 commit intolearningequality:unstablefrom
rtibbles:dotpath_deletion
Apr 13, 2022
Merged

Tests and updates for addition/deletion of metadata labels#3354
rtibbles merged 1 commit intolearningequality:unstablefrom
rtibbles:dotpath_deletion

Conversation

@rtibbles
Copy link
Copy Markdown
Member

Summary

Description of the change(s) you made

  • Updates the metadata labels to not squash previous edits with new changes
  • Updates handling of JSONFieldDictSerializer to remove keys when they are set as None to match the expected behaviour from Dexie generated update events.
  • Adds regression tests for this behaviour

Manual verification steps performed

Ran the new tests!

@rtibbles rtibbles requested a review from bjester March 28, 2022 21:34
else:
raise ValidationError("Tried to access a dot path in an invalid type")
# Finally, delete the final key
obj.pop(key.split(".")[-1])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is an intense chunk of code. The key splitting, object resolution piece seems like it could be a utility function? Is it something we do elsewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have something not dissimilar on the client side, I think we could turn it into a utility function, but wanted to keep it constrained for now until we work out exactly how we'd want it to be generalizable.

@rtibbles rtibbles merged commit f78ab9a into learningequality:unstable Apr 13, 2022
@rtibbles rtibbles deleted the dotpath_deletion branch April 13, 2022 21:35
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