I’m experiencing an issue with the QuickBooks connector on my Airbyte OSS installation. When attempting to connect to the QuickBooks source, I receive the following error:
2024-06-06 16:57:12 [46mplatform[0m > Encountered an error trying to connect to stream accounts. Error:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/checks/check_stream.py”, line 42, in check_connection
stream_is_available, reason = availability_strategy.check_availability(stream, logger, source)
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/availability_strategy.py”, line 50, in check_availability
get_first_record_for_slice(stream, stream_slice)
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/utils/stream_helper.py”, line 40, in get_first_record_for_slice
return next(records_for_slice)
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py”, line 126, in read_records
yield from self.retriever.read_records(self.get_json_schema(), stream_slice)
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py”, line 339, in read_records
self.cursor.close_slice(_slice, most_recent_record_from_slice)
File “/airbyte/integration_code/source_quickbooks/components.py”, line 72, in close_slice
most_recent_record=LastRecordDictProxy(most_recent_record, {self.cursor_field.eval(self.config): “MetaData/LastUpdatedTime”}),
AttributeError: ‘str’ object has no attribute ‘eval’
2024-06-06 16:57:12 [46mplatform[0m > Check failed
2024-06-06 16:57:12 [46mplatform[0m > Check connection job received output: io.airbyte.config.StandardCheckConnectionOutput@71baad3d[status=failed,message=”Unable to connect to stream accounts – ‘str’ object has no attribute ‘eval'”,additionalProperties={}]
The error indicates that there is an attempt to call eval on a string, which is not a valid operation. Specifically, the error is raised in the close_slice method of the CustomDatetimeBasedCursor class in components.py:
python
class CustomDatetimeBasedCursor(DatetimeBasedCursor):
def close_slice(self, stream_slice: StreamSlice, most_recent_record: typing.Optional[Record]) -> None:
super(CustomDatetimeBasedCursor, self).close_slice(
stream_slice=stream_slice,
most_recent_record=LastRecordDictProxy(most_recent_record, {self.cursor_field.eval(self.config): “MetaData/LastUpdatedTime”}),
)