-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(polars): use
drop_table
when cleaning the cache and remove dupl…
…icated `_remove_table` method (#9922)
- Loading branch information
Showing
3 changed files
with
28 additions
and
6 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
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,24 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
from ibis.backends.tests.errors import PolarsSQLInterfaceError | ||
from ibis.util import gen_name | ||
|
||
|
||
def test_cannot_run_sql_after_drop(con): | ||
t = con.table("functional_alltypes") | ||
n = t.count().execute() | ||
|
||
name = gen_name("polars_dot_sql") | ||
con.create_table(name, t) | ||
|
||
sql = f"SELECT COUNT(*) FROM {name}" | ||
|
||
expr = con.sql(sql) | ||
result = expr.execute() | ||
assert result.iat[0, 0] == n | ||
|
||
con.drop_table(name) | ||
with pytest.raises(PolarsSQLInterfaceError): | ||
con.sql(sql) |
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