diff --git a/singer_sdk/helpers/jsonpath.py b/singer_sdk/helpers/jsonpath.py index 9e2956f19..82c514b41 100644 --- a/singer_sdk/helpers/jsonpath.py +++ b/singer_sdk/helpers/jsonpath.py @@ -2,6 +2,7 @@ from __future__ import annotations +import logging import typing as t import memoization @@ -11,6 +12,9 @@ import jsonpath_ng +logger = logging.getLogger(__name__) + + def extract_jsonpath( expression: str, input: dict | list, # noqa: A002 @@ -27,7 +31,11 @@ def extract_jsonpath( compiled_jsonpath = _compile_jsonpath(expression) match: jsonpath_ng.DatumInContext - for match in compiled_jsonpath.find(input): + matches = compiled_jsonpath.find(input) + + logger.info("JSONPath matches: %d", len(matches)) + + for match in matches: yield match.value