Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[source-adjust] time date format is wrong after migration to lowcode #41054

Open
1 task done
tim-werner opened this issue Jul 9, 2024 · 1 comment
Open
1 task done

Comments

@tim-werner
Copy link
Contributor

Connector Name

source-adjust

Connector Version

0.1.4, 0.1.5,0.1.6

What step the error happened?

Configuring a new connector

Relevant information

The time date format that is passed to the adjust API is wrong. The adjust connector passes a date '%Y-%m-%d' to the API but the API expects the format like '%Y-%m-%dT%H:%M:%SZ'.

The fix would be possible to change the manifest.yaml for the DatetimeBasedCursor from datetime_format: "%Y-%m-%d" to datetime_format: "%Y-%m-%dT%H:%M:%SZ".

Relevant log output

Encountered an error trying to connect to stream AdjustReport. 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 36, in check_availability
stream_slice = get_first_stream_slice(stream)
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/utils/stream_helper.py", line 21, in get_first_stream_slice
stream.stream_slices(
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py", line 148, 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 378, 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 168, 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 173, 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) # type: ignore # datetime is always cast to an interpolated string
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 '2024-07-01' does not match format '%Y-%m-%dT%H:%M:%SZ'

Contribute

  • Yes, I want to contribute
@tim-werner tim-werner added area/connectors Connector related issues needs-triage type/bug Something isn't working labels Jul 9, 2024
@marcosmarxm marcosmarxm changed the title source-adjust time date format is wrong after migration to lowcode [source-adjust] time date format is wrong after migration to lowcode Jul 11, 2024
@marcosmarxm
Copy link
Member

Thanks for the quick fix @tim-werner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants