tisonkun opened a new issue, #192:
URL: https://github.com/apache/datasketches-rust/issues/192

   ThetaIntersection::to_sketch and TupleIntersection::to_sketch currently 
panic when called before the first update. Both operators expose has_result, 
and tests explicitly cover the panic, but absence of an intersection state is 
part of the public state machine and deserves a deliberate API contract.
   
   We should decide whether result extraction should:
   
   - return Option when no result is a normal state;
   - return Result when calling before update is considered recoverable misuse; 
or
   - retain the panic, with a clear invariant and local Panics documentation.
   
   Points to settle:
   
   - Apply the same contract to Theta and Tuple intersections.
   - Decide whether has_result remains useful after result extraction becomes 
typed.
   - Define the mathematical meaning of zero updates; the identity for 
intersection cannot be represented as a finite sketch.
   - Consider reset if it is added to the operators later.
   - Check Java and C++ precedent, while keeping the Rust API misuse-resistant.
   - Document migration if the return type changes before 1.0.
   
   This issue intentionally records the design question rather than prescribing 
Option or Result immediately.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to