dlt.sources.incremental(
cursor_path="updated_at",
initial_value="2024-01-01",
end_value="2024-01-31", # This is ineffective code that looks as if it's doing something
)
Expected behavior
Instead of ignoring the end_value key it should throw a ValueError and explain that to specify an end_value the user has to create an incremental configuration at the resource level and not at the parameter level.
Steps to reproduce
param_config = {
"since": {
"type": "incremental",
"cursor_path": "updated_at",
"initial_value": "2024-01-01T00:00:00Z",
"end_value": "2024-06-30T00:00:00Z",
}
}
(incremental_obj, incremental_param, transform) = setup_incremental_object(
param_config, None
)
incremental_with_init_and_end = dlt.sources.incremental(
cursor_path="updated_at",
initial_value="2024-01-01T00:00:00Z",
end_value="2024-06-30T00:00:00Z",
)
# Here the incremental object contains an end value but the incremental param only has the start value
assert incremental_with_init_and_end == incremental_obj
assert incremental_param == IncrementalParam(start="since", end=None)
dlt version
0.4.11
Source name
rest_api
Describe the problem
Currently,
results in:
Expected behavior
Instead of ignoring the
end_value
key it should throw aValueError
and explain that to specify anend_value
the user has to create an incremental configuration at the resource level and not at the parameter level.Steps to reproduce
How you are using the source?
I run this source in production.
Operating system
macOS
Runtime environment
Local
Python version
3.11
dlt destination
duckdb
Additional information
No response