Skip to content

Commit 54d4e2d

Browse files
fix: Restore copyright header and add negative test case for page_size interpolation
Co-Authored-By: [email protected] <[email protected]>
1 parent afad0ce commit 54d4e2d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
2+
13
# generated by datamodel-codegen:
24
# filename: declarative_component_schema.yaml
35

unit_tests/sources/declarative/requesters/paginators/test_cursor_pagination_strategy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,15 @@ def test_interpolated_page_size(page_size_input, config, expected_page_size):
141141
parameters={},
142142
)
143143
assert strategy.get_page_size() == expected_page_size
144+
145+
146+
def test_interpolated_page_size_raises_on_non_integer():
147+
"""Test that get_page_size raises an exception when interpolation resolves to a non-integer."""
148+
strategy = CursorPaginationStrategy(
149+
page_size="{{ config['page_size'] }}",
150+
cursor_value="token",
151+
config={"page_size": "invalid"},
152+
parameters={},
153+
)
154+
with pytest.raises(Exception, match="is of type .* Expected"):
155+
strategy.get_page_size()

0 commit comments

Comments
 (0)