Skip to content

Commit

Permalink
Fixing the issues reported by pytype with the new feature enabled.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 701924306
  • Loading branch information
FHIR Team authored and copybara-github committed Dec 3, 2024
1 parent 6e36939 commit c7d2264
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions google-fhir-core/google/fhir/core/fhir_path/_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class StructureBaseNode(ExpressionNode):
def __init__(
self,
fhir_context: context.FhirPathContext,
return_type: Optional[_fhir_path_data_types.FhirPathDataType],
return_type: _fhir_path_data_types.FhirPathDataType,
) -> None:
self._fixed_return_type = return_type
super().__init__(fhir_context)
Expand Down Expand Up @@ -448,8 +448,10 @@ def parent_node(self):
def accept(self, visitor: 'ExpressionNodeBaseVisitor') -> Any:
return visitor.visit_literal(self)

def get_value(self) -> message.Message:
def get_value(self) -> Optional[message.Message]:
"""Returns a defensive copy of the literal value."""
if self._value is None:
return None
return copy.deepcopy(self._value)

def to_path_token(self) -> str:
Expand Down

0 comments on commit c7d2264

Please sign in to comment.