Skip to content

Commit eecb6c2

Browse files
fix: move rendering/serialization inside try/except for API path error wrapping
Co-Authored-By: Ryan Waskewich <ryan.waskewich@airbyte.io>
1 parent e484f05 commit eecb6c2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

airbyte_cdk/sources/file_based/file_types/unstructured_parser.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ def _read_file(
257257
format.strategy,
258258
remote_file,
259259
)
260+
if format.output_format == "markdown_json":
261+
return json.dumps(elements)
262+
return self._render_markdown(elements)
260263
except Exception as e:
261264
# If a parser error happens during remotely processing the file, this means the file is corrupted. This case is handled by the parse_records method, so just rethrow.
262265
#
@@ -268,10 +271,6 @@ def _read_file(
268271
e, failure_type=FailureType.config_error
269272
)
270273

271-
if format.output_format == "markdown_json":
272-
return json.dumps(elements)
273-
return self._render_markdown(elements)
274-
275274
def _params_to_dict(
276275
self, params: Optional[List[APIParameterConfigModel]], strategy: str
277276
) -> Dict[str, Union[str, List[str]]]:

0 commit comments

Comments
 (0)