Skip to content

Commit

Permalink
test: Fix flaky duckdb test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Oct 8, 2024
1 parent 748b953 commit a1af546
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lumen/tests/sources/test_duckdb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import datetime as dt
import os

from shutil import copy2

import pandas as pd
import pytest

Expand All @@ -15,8 +17,10 @@


@pytest.fixture
def duckdb_source():
root = os.path.dirname(__file__)
def duckdb_source(tmp_path):
file = os.path.join(os.path.dirname(__file__), 'test.db')
root = str(tmp_path)
copy2(file, root)
duckdb_source = DuckDBSource(
initializers=[
"INSTALL sqlite;",
Expand Down Expand Up @@ -122,7 +126,6 @@ def test_duckdb_filter(duckdb_source, table_column_value_type, dask, expected_fi
pd.testing.assert_frame_equal(filtered, expected_filtered_df.reset_index(drop=True))


@pytest.mark.flaky(reruns=3)
def test_duckdb_transforms(duckdb_source, source_tables):
df_test_sql = source_tables['test_sql']
transforms = [SQLGroupBy(by=['B'], aggregates={'SUM': 'A'})]
Expand All @@ -131,7 +134,6 @@ def test_duckdb_transforms(duckdb_source, source_tables):
pd.testing.assert_frame_equal(transformed, expected)


@pytest.mark.flaky(reruns=3)
def test_duckdb_transforms_cache(duckdb_source, source_tables):
df_test_sql = source_tables['test_sql']
transforms = [SQLGroupBy(by=['B'], aggregates={'SUM': 'A'})]
Expand Down

0 comments on commit a1af546

Please sign in to comment.