Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KeXiangWang committed Jan 25, 2024
1 parent 4284d77 commit 534374e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 54 deletions.
18 changes: 4 additions & 14 deletions ibis/backends/risingwave/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
from __future__ import annotations

# Copyright 2015 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from typing import TYPE_CHECKING, Any

Expand Down Expand Up @@ -85,14 +72,17 @@ def _load_data(

@staticmethod
def connect(*, tmpdir, worker_id, port: int | None = None, **kw):
return ibis.risingwave.connect(
con = ibis.risingwave.connect(
host=PG_HOST,
port=port or PG_PORT,
user=PG_USER,
password=PG_PASS,
database=IBIS_TEST_RISINGWAVE_DB,
**kw,
)
cursor = con.raw_sql("SET RW_IMPLICIT_FLUSH TO true;")
cursor.close()
return con


@pytest.fixture(scope="session")
Expand Down
16 changes: 1 addition & 15 deletions ibis/backends/risingwave/tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Copyright 2015 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

import os
Expand Down Expand Up @@ -60,14 +47,13 @@ def test_simple_aggregate_execute(alltypes):


def test_list_tables(con):
assert len(con.list_tables()) > 0
assert con.list_tables()
assert len(con.list_tables(like="functional")) == 1


def test_compile_toplevel(snapshot):
t = ibis.table([("foo", "double")], name="t0")

# it works!
expr = t.foo.sum()
result = ibis.postgres.compile(expr)
snapshot.assert_match(str(result), "out.sql")
Expand Down
25 changes: 0 additions & 25 deletions ibis/backends/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,6 @@ def employee_data_2_temp_table(
alchemy_con.drop_table(temp_table_name, force=True)


@pytest.mark.broken(
["risingwave"],
raises=AssertionError,
reason="TODO(Kexiang): Seem a bug",
)
def test_insert_no_overwrite_from_dataframe(
alchemy_backend,
alchemy_con,
Expand All @@ -473,11 +468,6 @@ def test_insert_no_overwrite_from_dataframe(
reason="Connector doesn't support deletion (required for overwrite=True)",
raises=sa.exc.ProgrammingError,
)
@pytest.mark.broken(
["risingwave"],
raises=AssertionError,
reason="TODO(Kexiang): Seem a bug",
)
def test_insert_overwrite_from_dataframe(
alchemy_backend,
alchemy_con,
Expand All @@ -499,11 +489,6 @@ def test_insert_overwrite_from_dataframe(
)


@pytest.mark.broken(
["risingwave"],
raises=AssertionError,
reason="TODO(Kexiang): Seem a bug",
)
def test_insert_no_overwrite_from_expr(
alchemy_backend,
alchemy_con,
Expand All @@ -526,11 +511,6 @@ def test_insert_no_overwrite_from_expr(
)


@pytest.mark.broken(
["risingwave"],
raises=AssertionError,
reason="TODO(Kexiang): Seem a bug",
)
def test_insert_overwrite_from_expr(
alchemy_backend,
alchemy_con,
Expand Down Expand Up @@ -581,11 +561,6 @@ def _emp(a, b, c, d):
assert len(alchemy_con.table(employee_data_1_temp_table).execute()) == 3


@pytest.mark.never(
["risingwave"],
raises=AssertionError,
reason="Feature is not yet implemented: CREATE TEMPORARY TABLE",
)
def test_insert_from_memtable(alchemy_con, alchemy_temp_table):
df = pd.DataFrame({"x": range(3)})
table_name = alchemy_temp_table
Expand Down

0 comments on commit 534374e

Please sign in to comment.