Skip to content

Commit e9ca6eb

Browse files
committed
fix tests
1 parent a7c0dd6 commit e9ca6eb

21 files changed

Lines changed: 40 additions & 50 deletions

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ jobs:
7979
shell: bash
8080
run: |
8181
if [[ "${{ inputs.testsuite }}" == "all" ]]; then
82-
uv run coverage run -m pytest -n 4 ./tests
82+
uv run coverage run -m pytest ./tests
8383
elif [[ "${{ inputs.testsuite }}" == "fast" ]]; then
84-
uv run coverage run -m pytest -n 4 ./tests/fast
84+
uv run coverage run -m pytest ./tests/fast
8585
else
8686
echo "Invalid testsuite!"
8787
exit 1

.github/workflows/packaging_sdist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
# run tests
8181
tests_root="${{ github.workspace }}/tests"
8282
tests_dir="${tests_root}${{ inputs.testsuite == 'fast' && '/fast' || '/' }}"
83-
uv run --verbose pytest -n 4 $tests_dir --verbose
83+
uv run --verbose pytest $tests_dir --verbose
8484
8585
- id: versioning
8686
run: |

.github/workflows/packaging_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
uv export --only-group test --no-emit-project --quiet --output-file pylock.toml --directory {project} &&
5454
uv pip install -r pylock.toml
5555
CIBW_TEST_COMMAND: >
56-
uv run -v pytest -n 4 ${{ inputs.testsuite == 'fast' && './tests/fast' || './tests' }} --verbose
56+
uv run -v pytest ${{ inputs.testsuite == 'fast' && './tests/fast' || './tests' }} --verbose
5757
5858
steps:
5959
- name: Checkout DuckDB Python

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ dev = [ # tooling like uv will install this automatically when syncing the envir
305305

306306
[tool.pytest.ini_options]
307307
minversion = "6.0"
308-
addopts = "-ra -q"
308+
addopts = "-ra --numprocesses 4 --dist loadfile"
309309
testpaths = ["tests"]
310310
filterwarnings = [
311311
"error",

tests/fast/api/test_duckdb_connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from conftest import ArrowPandas, NumpyPandas
55

66
import duckdb
7-
import duckdb.typing
87

98
pa = pytest.importorskip("pyarrow")
109

tests/fast/arrow/test_arrow_fetch_recordbatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def test_record_batch_reader_from_relation(self, duckdb_cursor):
234234
duckdb_cursor = duckdb.connect()
235235
duckdb_cursor.execute("CREATE table t as select range a from range(3000);")
236236
relation = duckdb_cursor.table("t")
237-
record_batch_reader = relation.record_batch()
237+
record_batch_reader = relation.fetch_record_batch()
238238
chunk = record_batch_reader.read_next_batch()
239239
assert len(chunk) == 3000
240240

tests/fast/arrow/test_buffer_size_option.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22

33
import duckdb
4-
from duckdb.typing import VARCHAR
4+
from duckdb.sqltypes import VARCHAR
55

66
pa = pytest.importorskip("pyarrow")
77

@@ -13,21 +13,21 @@ def test_arrow_buffer_size(self):
1313
# All small string
1414
res = con.query("select 'bla'").fetch_arrow_table()
1515
assert res[0][0].type == pa.string()
16-
res = con.query("select 'bla'").record_batch()
16+
res = con.query("select 'bla'").fetch_record_batch()
1717
assert res.schema[0].type == pa.string()
1818

1919
# All Large String
2020
con.execute("SET arrow_large_buffer_size=True")
2121
res = con.query("select 'bla'").fetch_arrow_table()
2222
assert res[0][0].type == pa.large_string()
23-
res = con.query("select 'bla'").record_batch()
23+
res = con.query("select 'bla'").fetch_record_batch()
2424
assert res.schema[0].type == pa.large_string()
2525

2626
# All small string again
2727
con.execute("SET arrow_large_buffer_size=False")
2828
res = con.query("select 'bla'").fetch_arrow_table()
2929
assert res[0][0].type == pa.string()
30-
res = con.query("select 'bla'").record_batch()
30+
res = con.query("select 'bla'").fetch_record_batch()
3131
assert res.schema[0].type == pa.string()
3232

3333
def test_arrow_buffer_size_udf(self):

tests/fast/arrow/test_timestamp_timezone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_timestamp_stream(self, duckdb_cursor):
6464
con.execute("create table t (i timestamptz)")
6565
con.execute("insert into t values (NULL),('2021-11-15 02:30:00'::timestamptz)")
6666
rel = con.table("t")
67-
arrow_tbl = rel.record_batch().read_all()
67+
arrow_tbl = rel.fetch_record_batch().read_all()
6868
con.register("t2", arrow_tbl)
6969

7070
assert con.execute("select * from t").fetchall() == con.execute("select * from t2").fetchall()

tests/fast/test_expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
LambdaExpression,
1414
StarExpression,
1515
)
16-
from duckdb.typing import INTEGER, TIMESTAMP, VARCHAR
16+
from duckdb.sqltypes import INTEGER, TIMESTAMP, TINYINT, VARCHAR
1717
from duckdb.value.constant import IntegerValue, Value
1818

1919
pytestmark = pytest.mark.skipif(
@@ -804,7 +804,7 @@ def test_numeric_overflow(self):
804804
with pytest.raises(duckdb.OutOfRangeException, match="Overflow in multiplication of INT16"):
805805
rel2.fetchall()
806806

807-
val = duckdb.Value(100, duckdb.typing.TINYINT)
807+
val = duckdb.Value(100, TINYINT)
808808
expr2 = ColumnExpression("salary") * val
809809
rel3 = rel.select(expr2)
810810
with pytest.raises(duckdb.OutOfRangeException, match="Overflow in multiplication of INT16"):

tests/fast/test_parquet.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import pytest
44

55
import duckdb
6+
import duckdb.sqltypes as duckdb_types
67

7-
VARCHAR = duckdb.typing.VARCHAR
8-
BIGINT = duckdb.typing.BIGINT
8+
VARCHAR = duckdb_types.VARCHAR
9+
BIGINT = duckdb_types.BIGINT
910

1011
filename = str(Path(__file__).parent / "data" / "binary_string.parquet")
1112

0 commit comments

Comments
 (0)