Skip to content

Source Twilio: Migrate connector from GA (Python) to GA (YAML) #21446

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

Closed
wants to merge 140 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
0621c87
switch to YamlDeclarativeSource
grubberr Jan 14, 2023
e63cc71
spec.json -> spec.yaml
grubberr Jan 14, 2023
6f26480
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 16, 2023
79f7518
check using accounts_stream implemented
grubberr Jan 16, 2023
0b71c15
field_pointer: ["accounts"]
grubberr Jan 16, 2023
b6383d6
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 17, 2023
d1e794e
accounts pk: id -> sid
grubberr Jan 17, 2023
9511bab
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 24, 2023
0a58b74
field_pointer use options
grubberr Jan 24, 2023
16b49f2
addresses_stream added
grubberr Jan 24, 2023
f0efdf5
applications_stream added
grubberr Jan 24, 2023
75ff630
incoming_phone_numbers_stream added
grubberr Jan 24, 2023
e806e8e
keys_stream added
grubberr Jan 24, 2023
27ed5bb
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 24, 2023
6de4b48
outgoing_caller_ids_stream added
grubberr Jan 24, 2023
e08014d
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 24, 2023
e33a511
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 25, 2023
01ea411
DefaultPaginator added
grubberr Jan 25, 2023
f13fe86
transcriptions_stream added
grubberr Jan 25, 2023
3fc3881
available_phone_number_countries_stream added
grubberr Jan 25, 2023
1c6df44
queues_stream added
grubberr Jan 25, 2023
4d382f8
parent_key now uses dpath
grubberr Jan 25, 2023
4fc15a8
substream_slicer - dpath added
grubberr Jan 26, 2023
d0aa59d
CHANGELOG.md updated
grubberr Jan 26, 2023
4663db5
bump 0.23.1
grubberr Jan 26, 2023
97aee2d
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 26, 2023
7767368
Merge branch 'master' into grubberr/cdk-declarative-fix-substream-slicer
grubberr Jan 26, 2023
e9aa21b
Merge branch 'grubberr/cdk-declarative-fix-substream-slicer' into gru…
grubberr Jan 26, 2023
14aea3c
available_phone_numbers_local_stream, available_phone_numbers_mobile_…
grubberr Jan 26, 2023
98930cd
dpath 2.1.4 -> 2.0.1
grubberr Jan 26, 2023
28d6395
code lint
grubberr Jan 26, 2023
9685b4e
test_missed_parent_key added
grubberr Jan 26, 2023
3355664
test_dpath_extraction added
grubberr Jan 26, 2023
d6427ef
Merge branch 'grubberr/cdk-declarative-fix-substream-slicer' into gru…
grubberr Jan 26, 2023
46203ec
make step InterpolatedString
grubberr Jan 26, 2023
8aa74ce
bump 0.25.1
grubberr Jan 26, 2023
4a20c3c
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 26, 2023
dfba799
Merge branch 'grubberr/cdk-declarative-fix-datetime-slicer-step' into…
grubberr Jan 26, 2023
dc9c2f6
cursor_format added
grubberr Jan 27, 2023
5e65df8
CHANGELOG.md updated
grubberr Jan 27, 2023
9476497
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 27, 2023
386e5f1
Merge branch 'grubberr/cdk-declarative-add-datetime-slicer-cursor_for…
grubberr Jan 27, 2023
047cee0
calls_stream added
grubberr Jan 27, 2023
2f5d38f
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 30, 2023
33e63db
lower_boundary_param, upper_boundary_param - added
grubberr Jan 30, 2023
5a0e3ae
extract base_incremental_nested_stream
grubberr Jan 30, 2023
c19acf6
conferences_stream added
grubberr Jan 30, 2023
3a950e4
Merge branch 'master' into grubberr/cdk-declarative-fix-substream-slicer
grubberr Jan 30, 2023
63b81b9
revert changelog and version
grubberr Jan 30, 2023
2f73709
Merge branch 'master' into grubberr/cdk-declarative-fix-datetime-slic…
grubberr Jan 30, 2023
8eff445
revert changelog and version
grubberr Jan 30, 2023
a5a4fa3
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Jan 30, 2023
54e192e
revert changelog and version
grubberr Jan 30, 2023
3c022ca
Merge branch 'grubberr/cdk-declarative-add-datetime-slicer-cursor_for…
grubberr Jan 30, 2023
5c2bd36
Merge branch 'grubberr/cdk-declarative-fix-datetime-slicer-step' into…
grubberr Jan 30, 2023
78d69f0
Merge branch 'grubberr/cdk-declarative-fix-substream-slicer' into gru…
grubberr Jan 30, 2023
813817b
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 30, 2023
3a4bdc8
move cursor_granularity to options, add step_default param
grubberr Jan 30, 2023
88c7a4e
extract boundary_format
grubberr Jan 30, 2023
5d31915
today_utc -> now_utc
grubberr Jan 30, 2023
d5b9abe
messages_stream added
grubberr Jan 30, 2023
0245613
bugfix primary_key added
grubberr Jan 30, 2023
eb08858
recordings_stream added
grubberr Jan 30, 2023
ff272a8
extract datetime_slicer
grubberr Jan 30, 2023
17890fe
extract boundary_request_parameters
grubberr Jan 30, 2023
0b5f4fe
alerts_stream added
grubberr Jan 30, 2023
4bf5d4d
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 31, 2023
73c2446
fix params for alerts stream
grubberr Jan 31, 2023
bc51a54
simplify TwilioCartesianProductStreamSlicer
grubberr Jan 31, 2023
b66e5f6
extract accounts_slicer
grubberr Jan 31, 2023
de52de4
usage_records_stream added
grubberr Jan 31, 2023
9fc110a
flows_stream added
grubberr Jan 31, 2023
bd2baa0
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Jan 31, 2023
4412835
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Jan 31, 2023
65b0dc2
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 1, 2023
e9c0a82
usage_records.json - fixed
grubberr Feb 1, 2023
6ac400d
schemas/flows.json addded
grubberr Feb 1, 2023
299a8bf
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 2, 2023
c223086
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 2, 2023
e52e667
usage_triggers added
grubberr Feb 2, 2023
a65573e
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 3, 2023
5f2d8fc
conference_participants_stream added
grubberr Feb 3, 2023
5344f67
dependent_phone_numbers_stream - added
grubberr Feb 3, 2023
b65c861
lookback_window added
grubberr Feb 4, 2023
67e9b86
messages_stream - added filtering
grubberr Feb 4, 2023
5037c06
message_media_stream added
grubberr Feb 4, 2023
6d7246d
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 4, 2023
fd569f9
datetime_transformation added
grubberr Feb 5, 2023
31ea82b
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 5, 2023
2a004e3
copy.deepcopy last_record
grubberr Feb 5, 2023
94d43a0
Merge branch 'grubberr/cdk-declarative-add-datetime-slicer-cursor_for…
grubberr Feb 5, 2023
138336f
checkpoint 1000 added
grubberr Feb 5, 2023
c534641
Retry-After added
grubberr Feb 5, 2023
176de68
improve slice_step_map parsing
grubberr Feb 5, 2023
0f7295d
remove tests, add comments, generalize TwilioCartesianProductStreamSl…
grubberr Feb 5, 2023
10d47ca
bump 0.1.16
grubberr Feb 5, 2023
9c97a52
bump 0.2.0, change twilio.md
grubberr Feb 5, 2023
78ddad3
twilio.md updated
grubberr Feb 5, 2023
111024d
adjust_datetime added
grubberr Feb 6, 2023
f9ce657
Merge branch 'grubberr/cdk-declarative-macros-adjust_datetime' into g…
grubberr Feb 6, 2023
73a362b
retention_window_limit added
grubberr Feb 6, 2023
0f85675
check for Mapping
grubberr Feb 6, 2023
1e2eae5
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 7, 2023
26c6f7a
Merge branch 'grubberr/cdk-declarative-add-datetime-slicer-cursor_for…
grubberr Feb 7, 2023
78154f4
day_delta fixed
grubberr Feb 7, 2023
3dbc655
Merge branch 'master' into grubberr/cdk-declarative-macros-adjust_dat…
grubberr Feb 7, 2023
6cbf4f3
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 7, 2023
933fc6e
Merge branch 'grubberr/cdk-declarative-macros-adjust_datetime' into g…
grubberr Feb 7, 2023
e059e31
use min_datetime
grubberr Feb 7, 2023
5f64ba4
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 7, 2023
c445d72
allowedHosts added
grubberr Feb 7, 2023
57fe5e9
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 8, 2023
02cbcad
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 9, 2023
d37fc3a
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 12, 2023
773cbc9
TwilioCartesianProductStreamSlicer -> NestedStateCartesianProductStre…
grubberr Feb 12, 2023
a97d916
twilio.yaml -> manifest.yaml
grubberr Feb 12, 2023
080a246
secrets removed from .dockerignore
grubberr Feb 12, 2023
bf30ec7
added docstring for NestedStateCartesianProductStreamSlicer
grubberr Feb 12, 2023
391ba58
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 16, 2023
9782fa7
Merge branch 'grubberr/cdk-declarative-add-datetime-slicer-cursor_for…
grubberr Feb 16, 2023
77b3fec
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 17, 2023
eb78167
switch on airbyte_cdk 0.29.0
grubberr Feb 17, 2023
a8f7109
stream_state_field_start -> partition_field_start
grubberr Feb 17, 2023
058b726
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 17, 2023
050d2dd
test_update_cursor updated
grubberr Feb 17, 2023
8aef0c3
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 21, 2023
656fc63
cursor_format -> cursor_datetime_format
grubberr Feb 21, 2023
2767f51
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 22, 2023
2a3d46c
"the" added
grubberr Feb 22, 2023
f9ab4e0
remove dot
grubberr Feb 22, 2023
931f7a4
Merge branch 'master' into grubberr/cdk-declarative-add-datetime-slic…
grubberr Feb 23, 2023
4636b0e
description improved
grubberr Feb 23, 2023
73f5b07
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Feb 23, 2023
cfc5af2
Merge branch 'grubberr/cdk-declarative-add-datetime-slicer-cursor_for…
grubberr Feb 23, 2023
4d7c07e
cursor_format -> cursor_datetime_format
grubberr Feb 23, 2023
5c6b899
Merge branch 'master' into grubberr/21337-source-twilio
grubberr Apr 5, 2023
7766bfa
bugfix
grubberr Apr 5, 2023
2934fb2
Automated Commit - Formatting Changes
grubberr Apr 5, 2023
4d62d85
source.py revert low-code
grubberr Apr 5, 2023
0006729
set manifest version 0.29.0
grubberr Apr 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ definitions:
datetime_format:
description: The format of the datetime
type: string
cursor_datetime_format:
description: The format string used to transform the datetime value in the API response into the format used by the cursor
type: string
cursor_granularity:
description: Smallest increment the datetime_format has (ISO 8601 duration) that is used to ensure the start of a slice does not overlap with the end of the previous one
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DatetimeBasedCursor(StreamSlicer):
partition_field_start (Optional[str]): partition start time field
partition_field_end (Optional[str]): stream slice end time field
lookback_window (Optional[InterpolatedString]): how many days before start_datetime to read data for (ISO8601 duration)
cursor_datetime_format (str): the format string used to transform the datetime value in the API response into the format used by the cursor
"""

start_datetime: Union[MinMaxDatetime, str]
Expand All @@ -61,6 +62,7 @@ class DatetimeBasedCursor(StreamSlicer):
partition_field_start: Optional[str] = None
partition_field_end: Optional[str] = None
lookback_window: Optional[Union[InterpolatedString, str]] = None
cursor_datetime_format: str = None

def __post_init__(self, parameters: Mapping[str, Any]):
if not isinstance(self.start_datetime, MinMaxDatetime):
Expand Down Expand Up @@ -100,6 +102,8 @@ def update_cursor(self, stream_slice: StreamSlice, last_record: Optional[Record]
stream_slice_value = stream_slice.get(self.cursor_field.eval(self.config))
stream_slice_value_end = stream_slice.get(self.partition_field_end.eval(self.config))
last_record_value = last_record.get(self.cursor_field.eval(self.config)) if last_record else None
if last_record_value and self.cursor_datetime_format:
last_record_value = self._format_datetime(self._parser.parse(last_record_value, self.cursor_datetime_format, self._timezone))
cursor = None
if stream_slice_value and last_record_value:
cursor = max(stream_slice_value, last_record_value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ class DatetimeBasedCursor(BaseModel):
description="The location of the value on a record that will be used as a bookmark during sync",
)
datetime_format: str = Field(..., description="The format of the datetime")
cursor_datetime_format: Optional[str] = Field(
None,
description="The format string used to transform the datetime value in the API response into the format used by the cursor",
)
cursor_granularity: str = Field(
...,
description="Smallest increment the datetime_format has (ISO 8601 duration) that is used to ensure the start of a slice does not overlap with the end of the previous one",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def create_datetime_based_cursor(self, model: DatetimeBasedCursorModel, config:
cursor_field=model.cursor_field,
cursor_granularity=model.cursor_granularity,
datetime_format=model.datetime_format,
cursor_datetime_format=model.cursor_datetime_format,
end_datetime=end_datetime,
start_datetime=start_datetime,
step=model.step,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

import copy
import json
import logging
from dataclasses import InitVar, dataclass, field
Expand Down Expand Up @@ -334,7 +335,7 @@ def parse_response(
records = self.record_selector.select_records(
response=response, stream_state=self.state, stream_slice=stream_slice, next_page_token=next_page_token
)
self._last_records = records
self._last_records = copy.deepcopy(records)
return records

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ def transform(
stream_state: Optional[StreamState] = None,
stream_slice: Optional[StreamSlice] = None,
) -> Record:
kwargs = {"record": record, "stream_state": stream_state, "stream_slice": stream_slice}
for parsed_field in self._parsed_fields:
value = parsed_field.value.eval(config, **kwargs)
dpath.util.new(record, parsed_field.path, value)
if isinstance(record, Mapping):
kwargs = {"record": record, "stream_state": stream_state, "stream_slice": stream_slice}
for parsed_field in self._parsed_fields:
value = parsed_field.value.eval(config, **kwargs)
dpath.util.new(record, parsed_field.path, value)

return record

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,53 +394,67 @@ def test_stream_slices(


@pytest.mark.parametrize(
"test_name, previous_cursor, stream_slice, last_record, expected_state",
"test_name, previous_cursor, stream_slice, last_record, expected_state, cursor_datetime_format",
[
("test_update_cursor_no_state_no_record", None, {}, None, {}),
("test_update_cursor_no_state_no_record", None, {}, None, {}, None),
(
"test_update_cursor_with_state_no_record",
None,
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
None,
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
None
),
(
"test_update_cursor_with_state_equals_record",
None,
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
None
),
(
"test_update_cursor_with_state_greater_than_record",
None,
{cursor_field: "2021-01-03T00:00:00.000000+0000"},
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
{cursor_field: "2021-01-03T00:00:00.000000+0000"},
None
),
(
"test_update_cursor_with_state_less_than_record",
None,
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
{cursor_field: "2021-01-03T00:00:00.000000+0000"},
{cursor_field: "2021-01-03T00:00:00.000000+0000"},
None
),
(
"test_update_cursor_with_state_less_than_previous_cursor",
"2021-01-03T00:00:00.000000+0000",
{cursor_field: "2021-01-02T00:00:00.000000+0000"},
{},
{cursor_field: "2021-01-03T00:00:00.000000+0000"},
None
),
(
"test_update_cursor_last_record_different_format",
"2021-01-03T00:00:00.000000+0000",
{},
{cursor_field: "Wed, 06 Jan 2021 00:00:00 +0000"},
{cursor_field: "2021-01-06T00:00:00.000000+0000"},
"%a, %d %b %Y %H:%M:%S %z"
),
],
)
def test_update_cursor(test_name, previous_cursor, stream_slice, last_record, expected_state):
def test_update_cursor(test_name, previous_cursor, stream_slice, last_record, expected_state, cursor_datetime_format):
slicer = DatetimeBasedCursor(
start_datetime=MinMaxDatetime(datetime="2021-01-01T00:00:00.000000+0000", parameters={}),
end_datetime=MinMaxDatetime(datetime="2021-01-10T00:00:00.000000+0000", parameters={}),
step="P1D",
cursor_field=InterpolatedString(string=cursor_field, parameters={}),
datetime_format=datetime_format,
cursor_datetime_format=cursor_datetime_format,
cursor_granularity=cursor_granularity,
lookback_window=InterpolatedString(string="0d", parameters={}),
config=config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2164,6 +2164,7 @@
hosts:
- api.twilio.com
- monitor.twilio.com
- studio.twilio.com
- name: Twilio Taskrouter
sourceDefinitionId: 2446953b-b794-429b-a9b3-c821ba992a48
dockerRepository: airbyte/source-twilio-taskrouter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
!main.py
!source_twilio
!setup.py
!secrets
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-e ../../bases/connector-acceptance-test
-e .
-e .
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-twilio/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
author_email="[email protected]",
packages=find_packages(),
install_requires=MAIN_REQUIREMENTS,
package_data={"": ["*.json", "schemas/*.json", "schemas/shared/*.json"]},
package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]},
extras_require={
"tests": TEST_REQUIREMENTS,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
"""
MIT License
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#

Copyright (c) 2020 Airbyte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from .source import SourceTwilio

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

from dataclasses import dataclass
from typing import Any, Iterable, Mapping, Optional

from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources.declarative.stream_slicers import CartesianProductStreamSlicer
from airbyte_cdk.sources.declarative.types import Record, StreamSlice


@dataclass
class NestedStateCartesianProductStreamSlicer(CartesianProductStreamSlicer):
"""
[Low-Code Custom Component] NestedStateCartesianProductStreamSlicer
https://github.com/airbytehq/airbyte/issues/22873

Some streams require support of nested state:
{
"recordings": {
"account_id": {
"date_created": "2023-01-19T23:30:52Z"
}
}
}
"""

def __post_init__(self, options: Mapping[str, Any]):
self._cursor = {}
self._options = options

def get_stream_state(self) -> Mapping[str, Any]:
return self._cursor

def stream_slices(self, sync_mode: SyncMode, stream_state: Mapping[str, Any]) -> Iterable[Mapping[str, Any]]:
record_slicer, datetime_slicer = self.stream_slicers
for record_slice in record_slicer.stream_slices(sync_mode, stream_state):
record_id = record_slice["record"]["sid"]
datetime_slicer._cursor = None
for datetime_slice in datetime_slicer.stream_slices(sync_mode, stream_state.get(record_id)):
yield record_slice | datetime_slice

def update_cursor(self, stream_slice: StreamSlice, last_record: Optional[Record] = None):
datetime_slicer = self.stream_slicers[1]
datetime_slicer.update_cursor(stream_slice, last_record)
if last_record:
record_id = stream_slice["record"]["sid"]
self._cursor.setdefault(record_id, {}).update(datetime_slicer.get_stream_state())
else:
self._cursor = stream_slice
Loading