Skip to content

Commit

Permalink
improve paginator errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed May 13, 2024
1 parent d26c5d0 commit 946fcd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dlt/sources/helpers/rest_client/paginators.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def __init__(
data is available. This allows you to limit the maximum number
of pages for pagination. Defaults to None.
"""
if total_path is None and maximum_page is None:
raise ValueError("Either `total_path` or `maximum_page` must be provided.")
super().__init__(
param_name=page_param,
initial_value=initial_page,
Expand Down Expand Up @@ -321,6 +323,8 @@ def __init__(
even if more data is available. This allows you to limit the
maximum range for pagination. Defaults to None.
"""
if total_path is None and maximum_offset is None:
raise ValueError("Either `total_path` or `maximum_offset` must be provided.")
super().__init__(
param_name=offset_param,
initial_value=offset,
Expand Down

0 comments on commit 946fcd0

Please sign in to comment.