Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In .patch serializer, default to "add" operation if no operation #2898

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

ashleysommer
Copy link
Contributor

In RDF .patch serializer, default to "add" operation if no operation or no target (diff) is given in kwargs.
This is because not all serializing codepaths allow passing kwargs.

This fixes the testsuite integration and allows round-trip tests to complete successfully with the .patch serializer.

I believe it is reasonable to expect that a user naively serializing their Graph to .patch format would want to default to add operation if no operation is given. In current implementation, no operation and no target results in a .patch file with only a header and no contents. This is considered a no-op file, and is likely not what the user wants.

Fixes the issue discussed at the bottom of #2877

Copy link
Contributor

@recalcitrantsupplant recalcitrantsupplant left a comment

Choose a reason for hiding this comment

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

Sounds sensible to me.

@ashleysommer ashleysommer merged commit 6882f5f into main Aug 27, 2024
22 checks passed
@ashleysommer ashleysommer deleted the default_add_patch_serailizer branch August 27, 2024 03:00
@ashleysommer ashleysommer mentioned this pull request Aug 27, 2024
7 tasks
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