Closed Gitznik closed 6 months ago
Thanks for suggesting this, you can submit the change. The question is how do you will assert the output of yield?
Good question. Feels quite tricky to do it in a robust way here.
Going down the stack trace, we could catch the pydantic.error_wrappers.ValidationError
error caused in https://github.com/airbytehq/airbyte/blob/bb39b36016ca32baba3a762ee2a56fe3da358bcc/airbyte-cdk/python/airbyte_cdk/sources/abstract_source.py#L317 when passing anything that is not a dict and raise a custom error with some additional information, e.g. this likely cause?
I imagine something like:
try:
message = AirbyteRecordMessage(stream=stream_name, data=data, emitted_at=now_millis)
except pydantic.error_wrappers.ValidationError as e:
if "value is not a valid dict" in str(e) :
raise TypeError("Should return an iterator of dics from parse response") from e
raise e
I think it is a good idea @Gitznik do you mind submitting a PR then I'll ask the CDK team to review it?
@Gitznik FYI I ended up having to revert https://github.com/airbytehq/airbyte/issues/17047 because the airbyte_protocol.py file is autogenerated by our build system. Will need to look for a better way to run this validation
At Airbyte, we seek to be clear about the project priorities and roadmap. This issue has not had any activity for 180 days, suggesting that it's not as critical as others. It's possible it has already been fixed. It is being marked as stale and will be closed in 20 days if there is no activity. To keep it open, please comment to let us know why it is important to you and if it is still reproducible on recent versions of Airbyte.
This issue was closed because it has been inactive for 20 days since being marked as stale.