Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 698671372
  • Loading branch information
Martin Huschenbett authored and copybara-github committed Nov 21, 2024
1 parent ed71c67 commit 11d7603
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_first_function_for_resource_succeeds(self):
# TODO(b/208900793): Consider revisiting when EvaluationResult supports
# other types and messages.
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'name.first().given.first()'),
self.builder('Patient').name.first().given.first(),
patient,
Expand Down Expand Up @@ -306,7 +306,7 @@ def test_indexer_for_resource_succeeds(self):
# TODO(b/208900793): Consider revisiting when EvaluationResult supports
# other types and messages.
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'name[0].given[0]'),
self.builder('Patient').name[0].given[0],
patient,
Expand All @@ -325,7 +325,7 @@ def test_indexer_for_resource_succeeds(self):
)

# Index out of bounds should result in an empty array.
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'name[0].given[2]'),
self.builder('Patient').name[0].given[2],
patient,
Expand Down Expand Up @@ -418,7 +418,7 @@ def test_empty_function_for_resource_succeeds(self):
def test_matches_function_for_resource_succeeds(self):
"""Tests the behavior of the matches() function."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', "name.first().given.matches('B')"),
self.builder('Patient').name.first().given.matches('B'),
patient,
Expand Down Expand Up @@ -858,9 +858,9 @@ def test_builder_arithmetic_for_resource_succeeds(
return

if right == 0:
self.assert_expression_result(div_expr, div_builder, patient, None)
self.assert_expression_result(mod_expr, mod_builder, patient, None)
self.assert_expression_result(
self.assert_expression_result(div_expr, div_builder, patient, None) # pytype: disable=wrong-arg-types
self.assert_expression_result(mod_expr, mod_builder, patient, None) # pytype: disable=wrong-arg-types
self.assert_expression_result( # pytype: disable=wrong-arg-types
trunc_div_expr, trunc_div_builder, patient, None
)
else:
Expand Down Expand Up @@ -899,7 +899,7 @@ def test_builder_with_none_handles_empty_collection(self):
def test_numeric_addition_arithmetic(self):
"""Tests addition logic for numeric values defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank + 1'),
self.builder('Patient').telecom.rank + 1,
patient,
Expand All @@ -916,7 +916,7 @@ def test_numeric_addition_arithmetic(self):
def test_numeric_subtraction_arithmetic(self):
"""Tests subtraction logic for numeric values defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank - 1'),
self.builder('Patient').telecom.rank - 1,
patient,
Expand All @@ -939,7 +939,7 @@ def test_numeric_subtraction_arithmetic(self):
def test_numeric_division_arithmetic(self):
"""Tests division logic on numeric values defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank / 1'),
self.builder('Patient').telecom.rank / 1,
patient,
Expand All @@ -952,7 +952,7 @@ def test_numeric_division_arithmetic(self):
patient,
3.25,
)
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank / 0'),
self.builder('Patient').telecom.rank / 0,
patient,
Expand All @@ -962,7 +962,7 @@ def test_numeric_division_arithmetic(self):
def test_numeric_modular_arithmetic(self):
"""Tests modulo logic on numeric values defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank mod 1'),
self.builder('Patient').telecom.rank % 1,
patient,
Expand All @@ -975,7 +975,7 @@ def test_numeric_modular_arithmetic(self):
patient,
7.0,
)
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank mod 0'),
self.builder('Patient').telecom.rank % 0,
patient,
Expand All @@ -985,7 +985,7 @@ def test_numeric_modular_arithmetic(self):
def test_numeric_trunc_div_arithmetic(self):
"""Tests truncated division logic defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank div 1'),
self.builder('Patient').telecom.rank // 1,
patient,
Expand All @@ -998,7 +998,7 @@ def test_numeric_trunc_div_arithmetic(self):
patient,
2.0,
)
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank div 0'),
self.builder('Patient').telecom.rank // 0,
patient,
Expand All @@ -1008,7 +1008,7 @@ def test_numeric_trunc_div_arithmetic(self):
def test_numeric_multiplication_arithmetic(self):
"""Tests multiplication logic on numeric values defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'telecom.rank * 1'),
self.builder('Patient').telecom.rank * 1,
patient,
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def test_non_literal_positive_polarity(self):
def test_string_arithmetic(self):
"""Tests string addition and concatenation logic defined at https://hl7.org/fhirpath/#math-2."""
patient = self._new_patient()
self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', "address.city + '1'"),
self.builder('Patient').address.city + '1',
patient,
Expand Down Expand Up @@ -1597,7 +1597,7 @@ def test_choice_type_sub_field_access_with_wrong_type_returns_empty(
compiled_expr = self.compile_expression('Observation', 'value.system')
built_expr = self.builder('Observation').value.system

self.assert_expression_result(compiled_expr, built_expr, observation, None)
self.assert_expression_result(compiled_expr, built_expr, observation, None) # pytype: disable=wrong-arg-types

def test_choice_type_invalid_sub_field_access_fails(self) -> None:
with self.assertRaisesRegex(
Expand Down Expand Up @@ -1692,7 +1692,7 @@ def test_to_integer_with_non_coercible_string_returns_empty(self) -> None:
address = patient.address.add()
address.state.value = 'abc'

self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'address.state.toInteger()'),
self.builder('Patient').address.state.toInteger(),
patient,
Expand Down Expand Up @@ -1736,7 +1736,7 @@ def test_to_integer_with_non_coercible_type_returns_emepty(self) -> None:
patient = self._new_patient()
patient.gender.value = 1

self.assert_expression_result(
self.assert_expression_result( # pytype: disable=wrong-arg-types
self.compile_expression('Patient', 'gender.toInteger()'),
self.builder('Patient').gender.toInteger(),
patient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def is_choice_type(message_or_descriptor: MessageOrDescriptorBase) -> bool:
Raises:
ValueError: Unable to retrieve options for type: <type>.
"""
return get_value_for_annotation_extension(message_or_descriptor,
return get_value_for_annotation_extension(message_or_descriptor, # pytype: disable=bad-return-type
annotations_pb2.is_choice_type)


Expand Down

0 comments on commit 11d7603

Please sign in to comment.