The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
When a user configure a record selection, we use dpath to fetch the nested object. However in the current state, dpath can raise an exception. Given a response body with empty keys, dpath does not allow for get. We can reproduce this error with a very small snippet of code:
import dpath.util
response_body = {"toto": {"tata": 1, "": 2}}
dpath.util.get(response_body, "toto", default=[])
Traceback (most recent call last):
File "/Users/maxime/.pyenv/versions/3.9.11/lib/python3.9/code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "/Users/maxime/devel/code/airbyte/airbyte-integrations/connectors/source-gnews/.venv/lib/python3.9/site-packages/dpath/util.py", line 173, in get
results = dpath.segments.fold(obj, f, [])
File "/Users/maxime/devel/code/airbyte/airbyte-integrations/connectors/source-gnews/.venv/lib/python3.9/site-packages/dpath/segments.py", line 347, in fold
for pair in walk(obj):
File "/Users/maxime/devel/code/airbyte/airbyte-integrations/connectors/source-gnews/.venv/lib/python3.9/site-packages/dpath/segments.py", line 73, in walk
for found in walk(v, location + (k,)):
File "/Users/maxime/devel/code/airbyte/airbyte-integrations/connectors/source-gnews/.venv/lib/python3.9/site-packages/dpath/segments.py", line 68, in walk
raise InvalidKeyName("Empty string keys not allowed without "
dpath.exceptions.InvalidKeyName: Empty string keys not allowed without dpath.options.ALLOW_EMPTY_STRING_KEYS=True: ('toto', '')
A user should be able to use record select even if it's response body contains empty strings.
Notes:
This is a request from Slack #help-connector-developemtn
What area the feature impact?
Connectors
Revelant Information
When a user configure a record selection, we use dpath to fetch the nested object. However in the current state, dpath can raise an exception. Given a response body with empty keys, dpath does not allow for
get
. We can reproduce this error with a very small snippet of code:A user should be able to use record select even if it's response body contains empty strings.
Notes: