File tree Expand file tree Collapse file tree
airbyte_cdk/sources/declarative/parsers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2927,8 +2927,14 @@ def create_offset_increment(
29272927 else None
29282928 )
29292929
2930+ # Pydantic v1 Union type coercion can convert int to string depending on Union order.
2931+ # If page_size is a string that represents an integer (not an interpolation), convert it back.
2932+ page_size = model .page_size
2933+ if isinstance (page_size , str ) and page_size .isdigit ():
2934+ page_size = int (page_size )
2935+
29302936 return OffsetIncrement (
2931- page_size = model . page_size ,
2937+ page_size = page_size ,
29322938 config = config ,
29332939 decoder = decoder_to_use ,
29342940 extractor = extractor ,
@@ -2940,8 +2946,14 @@ def create_offset_increment(
29402946 def create_page_increment (
29412947 model : PageIncrementModel , config : Config , ** kwargs : Any
29422948 ) -> PageIncrement :
2949+ # Pydantic v1 Union type coercion can convert int to string depending on Union order.
2950+ # If page_size is a string that represents an integer (not an interpolation), convert it back.
2951+ page_size = model .page_size
2952+ if isinstance (page_size , str ) and page_size .isdigit ():
2953+ page_size = int (page_size )
2954+
29432955 return PageIncrement (
2944- page_size = model . page_size ,
2956+ page_size = page_size ,
29452957 config = config ,
29462958 start_from_page = model .start_from_page or 0 ,
29472959 inject_on_first_request = model .inject_on_first_request or False ,
You can’t perform that action at this time.
0 commit comments