Skip to content

Commit 8dc4223

Browse files
[core] fix: correctly parser nested customizers
1 parent 9c3a98e commit 8dc4223

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

libs/core/garf_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
'ApiReportFetcher',
2727
]
2828

29-
__version__ = '0.6.1'
29+
__version__ = '0.6.2'

libs/core/garf_core/parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def _process_nested_field(self, row, customizer, field):
158158
}
159159
)
160160
try:
161-
return self.parse_row_element(field, customizer.value)
162-
except AttributeError as e:
161+
return self.parse_row_element(nested_field, customizer.value)
162+
except (query_parser.GarfFieldError, AttributeError) as e:
163163
raise query_parser.GarfCustomizerError(
164164
f'nested field {customizer.value} is missing in row {row}'
165165
) from e

libs/core/tests/unit/test_parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def test_parse_response_raises_customizer_error_on_missing_nested_attribute(
268268
]
269269
)
270270
with pytest.raises(
271-
query_parser.GarfFieldError,
272-
match='field missing_element is missing in row resource_data',
271+
query_parser.GarfCustomizerError,
272+
match='nested field missing_element is missing in row',
273273
):
274274
test_parser.parse_response(test_response)

0 commit comments

Comments
 (0)