Repository navigation
feat: user predicates and aggregates (#180) - #16
Merged
Merged
Conversation
Copies minigraf-binding-template#9: MiniGrafUdfError, the three with_foreign traits, MiniGrafDb.register_predicate/register_aggregate over the core's try_register_*, and handle locks that only clone the database, with the template's Rust tests. Pins core v3 at 02243f16. The package exports Predicate, Aggregate, Accumulator and UdfError. pytest covers a predicate, an aggregate in :find and :over, UdfError and any other exception as QRY-014, a bad Ref from finish, a predicate querying the same database, INT-040, and two threads sharing one predicate. The consumer contract gains a predicate and an aggregate, CI runs cargo test, and the README gains "User functions". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
…ate at once, exact foreign-exception message (#180) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
10 tasks done
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.
PR 3 of minigraf#180 (plan steps 17–20, spec §6/§6.1): UDF registration in the Python binding.
src/lib.rs): copied from minigraf-binding-template#9 (1faf4117) —MiniGrafUdfError(+From<UnexpectedUniFFICallbackError>), the three#[uniffi::export(with_foreign)]traits,MiniGrafDb.register_predicate/register_aggregateovertry_register_*, and handle locks that only clone theMinigraf; with the template's Rust tests.Predicate,Aggregate,Accumulator,UdfError(and theMiniGraf*names).tests/test_udf.py): predicate; aggregate in:findand:over;UdfErrorand any other exception →MiniGrafError.QueryQRY-014(exact message checked); badReffromfinish; UDFs through cursors and prepared queries, incl. a failure in a cursor; a predicate querying the same db;INT-040; two threads sharing one predicate; two queries inside one predicate at once (barrier — fails if the GIL or a binding lock were held across the core).adult?predicate, aproductaggregate andQRY-014on a raise.cargo test, so the copied Rust tests run.Tests were red before the shim change (import error), green after: 58 pytest, 44 Rust tests, clippy
-D warningsand fmt clean. Codex review findings (three test gaps) are addressed in the second commit.Part of project-minigraf/minigraf#180.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x