Skip to content

Commit

Permalink
fix bk (#24320)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
benpankow authored Sep 9, 2024
1 parent bb6fe9b commit 41bdf05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pandas as pd

import dagster as dg


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 41bdf05

Please sign in to comment.