Skip to content

refactor: wire try_from_json() into production and clean up test memory#235

Merged
pinodeca merged 1 commit into
microsoft:mainfrom
iemejia:followup/wire-try-from-json-and-test-cleanup
Jun 15, 2026
Merged

refactor: wire try_from_json() into production and clean up test memory#235
pinodeca merged 1 commit into
microsoft:mainfrom
iemejia:followup/wire-try-from-json-and-test-cleanup

Conversation

@iemejia

@iemejia iemejia commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #220 addressing review feedback from @pinodeca:

  1. Wire try_from_json() into a production caller — replaced direct serde_json::from_str::<Durofut> calls in explain.rs with Durofut::try_from_json(), so the fallible deserializer is no longer an unused parallel API.

  2. Test memory cleanup — extracted a build_wide_join(n) helper that serializes the template node once and clones via vec![value; n] instead of calling to_value() per-iteration 10k times. Both node-count tests in types.rs and the pg_test in lib.rs now use this pattern for predictable memory.

Net: -18 lines, no behavioral changes.

- Wire Durofut::try_from_json() into explain.rs production code paths,
  replacing direct serde_json::from_str::<Durofut> calls. This gives
  the fallible deserializer an actual production caller, removing the
  maintenance hazard of shipping an unused parallel API.

- Refactor node-count limit tests to serialize the template Durofut
  once and clone via vec![value; N] instead of calling to_value() in a
  loop N times. Extract a build_wide_join() helper to deduplicate the
  pattern across both node-count tests.

Follow-up from PR microsoft#220 review feedback.

Assisted-by: OpenCode:claude-opus-4.6

@pinodeca pinodeca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed with Opus 4.8.

LGTM!

@pinodeca pinodeca merged commit 3e39ac4 into microsoft:main Jun 15, 2026
5 checks passed
This was referenced Jun 17, 2026
@iemejia iemejia deleted the followup/wire-try-from-json-and-test-cleanup branch June 18, 2026 14:59
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