Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Dec 15, 2024
1 parent ac31cfd commit a05ee7c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/extract/test_incremental.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from time import sleep
from typing import Any, Optional, Literal, Sequence, Dict, Iterable
from unittest import mock
import itertools

import duckdb
import pyarrow as pa
Expand Down Expand Up @@ -3853,7 +3854,6 @@ def some_data():
for col in table_schema["columns"].values():
assert "incremental" not in col


@pytest.mark.parametrize("item_type", ALL_TEST_DATA_ITEM_FORMATS)
@pytest.mark.parametrize("last_value_func", [min, max])
def test_start_range_open(item_type: TestDataItemFormat, last_value_func: Any) -> None:
Expand Down Expand Up @@ -3960,3 +3960,18 @@ def some_data(

# Includes values 5-10 inclusive
assert items == expected_items

def test_incremental_and_limit():

@dlt.resource(incremental=dlt.sources.incremental(cursor_path="id", initial_value=0, last_value_func=min))
def resource():
for i in range(100):
yield {
"id": i,
"value": str(i),
}

p = dlt.pipeline(pipeline_name="incremtal_limit", destination="duckdb", dev_mode=True)

p.run(resource().add_limit(10))

0 comments on commit a05ee7c

Please sign in to comment.