Skip to content

Commit

Permalink
Airbyte CDK: rev non-related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
artem1205 committed Nov 11, 2024
1 parent 52d52b2 commit 3fe7ac4
Showing 1 changed file with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@
from airbyte_cdk.sources.streams.concurrent.state_converters.datetime_stream_state_converter import (
CustomFormatConcurrentStreamStateConverter,
DateTimeStreamStateConverter,
EpochValueConcurrentStreamStateConverter,
)
from airbyte_cdk.sources.streams.http.error_handlers.response_models import ResponseAction
from airbyte_cdk.sources.types import Config
Expand Down Expand Up @@ -806,18 +805,13 @@ def create_concurrent_cursor_from_datetime_based_cursor(
lookback_window = parse_duration(evaluated_lookback_window)

connector_state_converter: DateTimeStreamStateConverter
if datetime_format == self.EPOCH_DATETIME_FORMAT:
connector_state_converter = EpochValueConcurrentStreamStateConverter(
is_sequential_state=True
)
else:
connector_state_converter = CustomFormatConcurrentStreamStateConverter(
datetime_format=datetime_format,
input_datetime_formats=datetime_based_cursor_model.cursor_datetime_formats,
is_sequential_state=True,
cursor_granularity=cursor_granularity,
# type: ignore # Having issues w/ inspection for GapType and CursorValueType as shown in existing tests. Confirmed functionality is working in practice
)
connector_state_converter = CustomFormatConcurrentStreamStateConverter(
datetime_format=datetime_format,
input_datetime_formats=datetime_based_cursor_model.cursor_datetime_formats,
is_sequential_state=True,
cursor_granularity=cursor_granularity,
# type: ignore # Having issues w/ inspection for GapType and CursorValueType as shown in existing tests. Confirmed functionality is working in practice
)

start_date_runtime_value: Union[InterpolatedString, str, MinMaxDatetime]
if isinstance(datetime_based_cursor_model.start_datetime, MinMaxDatetimeModel):
Expand Down Expand Up @@ -871,7 +865,7 @@ def create_concurrent_cursor_from_datetime_based_cursor(
)

# When step is not defined, default to a step size from the starting date to the present moment
step_length = datetime.datetime.now(tz=datetime.timezone.utc) - start_date
step_length = datetime.timedelta.max
interpolated_step = (
InterpolatedString.create(
datetime_based_cursor_model.step,
Expand Down

0 comments on commit 3fe7ac4

Please sign in to comment.