@@ -1680,7 +1680,12 @@ def create_declarative_stream(
16801680
16811681 def _build_stream_slicer_from_partition_router (
16821682 self ,
1683- model : Union [AsyncRetrieverModel , CustomRetrieverModel , SimpleRetrieverModel , StateDelegatingRetrieverModel ],
1683+ model : Union [
1684+ AsyncRetrieverModel ,
1685+ CustomRetrieverModel ,
1686+ SimpleRetrieverModel ,
1687+ StateDelegatingRetrieverModel ,
1688+ ],
16841689 config : Config ,
16851690 ) -> Optional [PartitionRouter ]:
16861691 if (
@@ -1726,7 +1731,10 @@ def _build_incremental_cursor(
17261731 cursor_component = self ._create_component_from_model (
17271732 model = incremental_sync_model , config = config
17281733 )
1729- is_global_cursor = hasattr (incremental_sync_model , "global_substream_cursor" ) and incremental_sync_model .global_substream_cursor
1734+ is_global_cursor = (
1735+ hasattr (incremental_sync_model , "global_substream_cursor" )
1736+ and incremental_sync_model .global_substream_cursor
1737+ )
17301738
17311739 if is_global_cursor :
17321740 return GlobalSubstreamCursor (
@@ -1756,7 +1764,12 @@ def _build_incremental_cursor(
17561764
17571765 def _build_resumable_cursor (
17581766 self ,
1759- model : Union [AsyncRetrieverModel , CustomRetrieverModel , SimpleRetrieverModel , StateDelegatingRetrieverModel ],
1767+ model : Union [
1768+ AsyncRetrieverModel ,
1769+ CustomRetrieverModel ,
1770+ SimpleRetrieverModel ,
1771+ StateDelegatingRetrieverModel ,
1772+ ],
17601773 stream_slicer : Optional [PartitionRouter ],
17611774 ) -> Optional [StreamSlicer ]:
17621775 if hasattr (model , "paginator" ) and model .paginator and not stream_slicer :
@@ -1778,12 +1791,17 @@ def _merge_stream_slicers(
17781791 if model .retriever .type == "StateDelegatingRetriever" and not model .incremental_sync :
17791792 raise ValueError ("StateDelegatingRetriever requires 'incremental_sync' to be enabled." )
17801793
1781- if model .retriever .type == "AsyncRetriever" and model .incremental_sync .type != "DatetimeBasedCursor" :
1794+ if (
1795+ model .retriever .type == "AsyncRetriever"
1796+ and model .incremental_sync .type != "DatetimeBasedCursor"
1797+ ):
17821798 # We are currently in a transition to the Concurrent CDK and AsyncRetriever can only work with the
17831799 # support or unordered slices (for example, when we trigger reports for January and February, the report
17841800 # in February can be completed first). Once we have support for custom concurrent cursor or have a new
17851801 # implementation available in the CDK, we can enable more cursors here.
1786- raise ValueError ("AsyncRetriever with cursor other than DatetimeBasedCursor is not supported yet." )
1802+ raise ValueError (
1803+ "AsyncRetriever with cursor other than DatetimeBasedCursor is not supported yet."
1804+ )
17871805
17881806 if model .retriever .type == "AsyncRetriever" and model .retriever .partition_router :
17891807 # Note that this development is also done in parallel to the per partition development which once merged
@@ -2059,9 +2077,7 @@ def create_dynamic_schema_loader(
20592077 self , model : DynamicSchemaLoaderModel , config : Config , ** kwargs : Any
20602078 ) -> DynamicSchemaLoader :
20612079 stream_slicer = self ._build_stream_slicer_from_partition_router (model .retriever , config )
2062- combined_slicers = self ._build_resumable_cursor (
2063- model .retriever , stream_slicer
2064- )
2080+ combined_slicers = self ._build_resumable_cursor (model .retriever , stream_slicer )
20652081
20662082 schema_transformations = []
20672083 if model .schema_transformations :
@@ -2916,9 +2932,7 @@ def create_http_components_resolver(
29162932 self , model : HttpComponentsResolverModel , config : Config
29172933 ) -> Any :
29182934 stream_slicer = self ._build_stream_slicer_from_partition_router (model .retriever , config )
2919- combined_slicers = self ._build_resumable_cursor (
2920- model .retriever , stream_slicer
2921- )
2935+ combined_slicers = self ._build_resumable_cursor (model .retriever , stream_slicer )
29222936
29232937 retriever = self ._create_component_from_model (
29242938 model = model .retriever ,
0 commit comments