Skip to content

feat: non-deterministic function detection and temporal improvements#376

Merged
AviAvni merged 1 commit intomainfrom
non-deterministic-functions
Apr 14, 2026
Merged

feat: non-deterministic function detection and temporal improvements#376
AviAvni merged 1 commit intomainfrom
non-deterministic-functions

Conversation

@AviAvni
Copy link
Copy Markdown
Contributor

@AviAvni AviAvni commented Apr 14, 2026

Summary

Split from #359.

  • Add non_deterministic field to GraphFn struct for tracking functions with non-deterministic output
  • Extend cypher_fn! macro with variants for non-deterministic functions
  • Implement plan_is_non_deterministic() — walks execution plan tree to detect non-deterministic function calls (needed by effects replication to decide whether to use effects or full re-execution)
  • Add zero-arg temporal overloads: date(), localtime(), localdatetime() returning current time
  • Add .transaction() temporal variants using Runtime::transaction_timestamp for consistent values within a transaction
  • Mark rand(), randomUUID(), timestamp() and temporal functions as non-deterministic

Test plan

  • cargo check passes
  • Temporal zero-arg functions return current date/time
  • plan_is_non_deterministic() correctly identifies plans with rand/timestamp calls

- Add `non_deterministic` field to GraphFn for tracking functions with
  non-deterministic output (rand, randomUUID, timestamp, etc.)
- Extend cypher_fn! macro with non-deterministic function variants
- Add plan_is_non_deterministic() to walk execution plans and detect
  non-deterministic function usage (used for effects replication decisions)
- Add zero-arg temporal overloads: date(), localtime(), localdatetime()
- Add .transaction() temporal variants using Runtime::transaction_timestamp
- Add transaction_timestamp field to Runtime struct

Split from #359.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@AviAvni has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 36 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 57 minutes and 36 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e00d1b3-964c-4022-b169-0577f49ec740

📥 Commits

Reviewing files that changed from the base of the PR and between d51f96e and 7b5d756.

📒 Files selected for processing (7)
  • graph/src/planner/mod.rs
  • graph/src/runtime/functions/aggregation.rs
  • graph/src/runtime/functions/conversion.rs
  • graph/src/runtime/functions/math.rs
  • graph/src/runtime/functions/mod.rs
  • graph/src/runtime/functions/temporal.rs
  • graph/src/runtime/runtime.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch non-deterministic-functions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AviAvni AviAvni merged commit cbf29a9 into main Apr 14, 2026
14 checks passed
@AviAvni AviAvni deleted the non-deterministic-functions branch April 14, 2026 13:08
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 13.67521% with 101 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.90%. Comparing base (d51f96e) to head (7b5d756).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
graph/src/planner/mod.rs 0.00% 75 Missing ⚠️
graph/src/runtime/functions/temporal.rs 26.47% 25 Missing ⚠️
graph/src/runtime/functions/mod.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #376      +/-   ##
==========================================
- Coverage   84.15%   83.90%   -0.26%     
==========================================
  Files         110      110              
  Lines       28963    29077     +114     
==========================================
+ Hits        24375    24397      +22     
- Misses       4588     4680      +92     
Flag Coverage Δ
fuzz 41.96% <13.67%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant