MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / CheckForMarkedAttributes

Function CheckForMarkedAttributes

extensions/select_optimization.cc:600–628  ·  view source on GitHub ↗

Check for unknowns or missing attributes.

Source from the content-addressed store, hash-verified

598
599// Check for unknowns or missing attributes.
600absl::StatusOr<absl::optional<Value>> CheckForMarkedAttributes(
601 ExecutionFrameBase& frame, const AttributeTrail& attribute_trail) {
602 if (attribute_trail.empty()) {
603 return absl::nullopt;
604 }
605
606 if (frame.unknown_processing_enabled() &&
607 frame.attribute_utility().CheckForUnknownExact(attribute_trail)) {
608 // Check if the inferred attribute is marked. Only matches if this attribute
609 // or a parent is marked unknown (use_partial = false).
610 // Partial matches (i.e. descendant of this attribute is marked) aren't
611 // considered yet in case another operation would select an unmarked
612 // descended attribute.
613 //
614 // TODO(uncreated-issue/51): this may return a more specific attribute than the
615 // declared pattern. Follow up will truncate the returned attribute to match
616 // the pattern.
617 return frame.attribute_utility().CreateUnknownSet(
618 attribute_trail.attribute());
619 }
620
621 if (frame.missing_attribute_errors_enabled() &&
622 frame.attribute_utility().CheckForMissingAttribute(attribute_trail)) {
623 return frame.attribute_utility().CreateMissingAttributeError(
624 attribute_trail.attribute());
625 }
626
627 return absl::nullopt;
628}
629
630absl::StatusOr<Value> OptimizedSelectImpl::ApplySelect(
631 ExecutionFrameBase& frame, const StructValue& struct_value) const {

Callers 1

EvaluateMethod · 0.70

Calls 8

CheckForUnknownExactMethod · 0.80
attributeMethod · 0.80
emptyMethod · 0.45
CreateUnknownSetMethod · 0.45

Tested by

no test coverage detected