From 41bdf0513ffa8d70b4d076ad55cff8b3ad54c791 Mon Sep 17 00:00:00 2001 From: Ben Pankow Date: Mon, 9 Sep 2024 10:19:31 -0700 Subject: [PATCH] fix bk (#24320) ## Summary Fixes BK - Run ruff - Adjust the duckdb test table to be defined locally in function rather than as a variable on the test class, this seems to fix the existing failure? Seems like a duckdb breakage rather than anything related to our integration https://buildkite.com/dagster/dagster-dagster/builds/93492#0191d7aa-ccba-4f6f-a440-2a903e619114 --- .../docs_beta_snippets/getting-started/quickstart.py | 1 + .../dagster-duckdb/dagster_duckdb_tests/test_resource.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/docs_beta_snippets/docs_beta_snippets/getting-started/quickstart.py b/examples/docs_beta_snippets/docs_beta_snippets/getting-started/quickstart.py index 7122b83c85585..ffe984aadee85 100644 --- a/examples/docs_beta_snippets/docs_beta_snippets/getting-started/quickstart.py +++ b/examples/docs_beta_snippets/docs_beta_snippets/getting-started/quickstart.py @@ -1,4 +1,5 @@ import pandas as pd + import dagster as dg diff --git a/python_modules/libraries/dagster-duckdb/dagster_duckdb_tests/test_resource.py b/python_modules/libraries/dagster-duckdb/dagster_duckdb_tests/test_resource.py index feebf5f3a9c8a..6f9e15480609e 100644 --- a/python_modules/libraries/dagster-duckdb/dagster_duckdb_tests/test_resource.py +++ b/python_modules/libraries/dagster-duckdb/dagster_duckdb_tests/test_resource.py @@ -7,19 +7,20 @@ def test_resource(tmp_path): - df = pd.DataFrame({"a": [1, 2, 3], "b": [5, 6, 7]}) + sample_df = pd.DataFrame({"a": [1, 2, 3], "b": [5, 6, 7]}) @asset def create_table(duckdb: DuckDBResource): + my_df = sample_df # noqa: F841 with duckdb.get_connection() as conn: - conn.execute("CREATE TABLE my_table AS SELECT * FROM df") + conn.execute("CREATE TABLE my_table AS SELECT * FROM my_df") @asset def read_table(duckdb: DuckDBResource): with duckdb.get_connection() as conn: res = conn.execute("SELECT * FROM my_table").fetchdf() - assert res.equals(df) + assert res.equals(sample_df) materialize( [create_table, read_table],