forked from letsql/letsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix: problem with multi-engine execution (letsql#70)
- Loading branch information
Showing
2 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
python/letsql/backends/let/tests/test_isolated_execution.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import ibis | ||
|
||
import letsql as ls | ||
|
||
|
||
def test_multiple_pipes(pg): | ||
"""This test address the issue reported on bug #69 | ||
link: https://github.com/letsql/letsql/issues/69 | ||
NOTE | ||
The previous tests didn't catch it because the con object registered the table batting. | ||
""" | ||
|
||
con = ls.connect() | ||
duckdb_con = ibis.duckdb.connect() | ||
table_name = "batting" | ||
pg_t = pg.table(table_name)[lambda t: t.yearID == 2015].pipe( | ||
con.register, f"pg-{table_name}" | ||
) | ||
db_t = duckdb_con.register(pg_t.to_pyarrow(), f"{table_name}")[ | ||
lambda t: t.yearID == 2014 | ||
].pipe(con.register, f"db-{table_name}") | ||
|
||
expr = pg_t.join( | ||
db_t, | ||
"playerID", | ||
) | ||
|
||
expr.execute() |