airbytehq / airbyte

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.
https://airbyte.com
Other
15.33k stars 3.96k forks source link

Source Braintree: date format #31061

Open incmaxim opened 11 months ago

incmaxim commented 11 months ago

Connector Name

Braintree

Connector Version

0.2.0

What step the error happened?

During the sync.

Relevant information

No response

Relevant log output

Syncing stream dispute_stream 0:00:00.833751 2023-10-04 16:29:29 source > No format in ['%Y-%m-%d %H:%M:%S'] matching 2023-10-04 Traceback (most recent call last): File "/airbyte/integration_code/main.py", line 13, in launch(source, sys.argv[1:]) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 200, in launch for message in source_entrypoint.run(parsed_args): File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 114, in run yield from map(AirbyteEntrypoint.airbyte_message_to_string, self.read(source_spec, config, config_catalog, state)) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 156, in read yield from self.source.read(self.logger, config, catalog, state) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/manifest_declarative_source.py", line 136, in read yield from super().read(logger, config, catalog, state) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 142, in read raise e File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 122, in read yield from self._read_stream( File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 197, in _read_stream for record in record_iterator: File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 266, in _read_incremental for message_counter, record_data_or_message in enumerate(records, start=1): File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py", line 104, in read_records yield from self.retriever.read_records(stream_slice) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 305, in read_records most_recent_record_from_slice = self._get_most_recent_record(most_recent_record_from_slice, stream_data, stream_slice) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 319, in _get_most_recent_record return current_most_recent if self.cursor.is_greater_than_or_equal(current_most_recent, record) else record File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py", line 283, in is_greater_than_or_equal return self.parse_date(first_cursor_value) >= self.parse_date(second_cursor_value) File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py", line 196, in parse_date raise ValueError(f"No format in {self.cursor_datetime_formats} matching {date}") ValueError: No format in ['%Y-%m-%d %H:%M:%S'] matching 2023-10-04

Contribute

rstml commented 9 months ago

Having the same issue. Any idea what is causing this?

arctica commented 7 months ago

Version 0.2.1 seems completely broken, fails to synchronize any stream due to a date value parsing issue.

  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 122, in read
    yield from self._read_stream(
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 194, in _read_stream
    for record in record_iterator:
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 230, in _read_incremental
    for record_data_or_message in stream_instance.read_incremental(
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/core.py", line 137, in read_incremental
    slices = self.stream_slices(
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py", line 126, in stream_slices
    return self.retriever.stream_slices()
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 348, in stream_slices
    return self.stream_slicer.stream_slices()
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py", line 141, in stream_slices
    start_datetime = self._calculate_earliest_possible_value(self._select_best_end_datetime())
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py", line 146, in _calculate_earliest_possible_value
    earliest_possible_start_datetime = min(self.start_datetime.get_datetime(self.config), end_datetime)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/datetime/min_max_datetime.py", line 58, in get_datetime
    time = self._parser.parse(str(self.datetime.eval(config, **additional_parameters)), datetime_format)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/datetime/datetime_parser.py", line 33, in parse
    parsed_datetime = datetime.datetime.strptime(str(date), format)
  File "/usr/local/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.9/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%SZ'
AGPapa commented 1 month ago

No format in ['%Y-%m-%d %H:%M:%S'] matching 2023-10-04

@incmaxim

I had a similar error message when running an incremental sync - mine was No format in ['%Y-%m-%d %H:%M:%S'] matching 2024-06-30T13:03:33. That should be fixed in version 0.3.1. Can you check if that fixed the issue for you too? I'm not sure if it's the same problem that you had, since the error messages are a little different.


time data '' does not match format '%Y-%m-%dT%H:%M:%SZ'

@arctica

I think that might be a different error. I noticed that I got that error message when I didn't set the "start date" in the braintree source. It's under a box you have to expand for "optional fields", but it didn't work for me unless I set that.

Screenshot 2024-07-05 at 12 30 28 PM