From 534374e3af06a578c0d632e485a4cd056fd22ffc Mon Sep 17 00:00:00 2001 From: Kexiang Wang Date: Wed, 24 Jan 2024 20:35:42 -0500 Subject: [PATCH] small fix --- ibis/backends/risingwave/tests/conftest.py | 18 +++---------- ibis/backends/risingwave/tests/test_client.py | 16 +----------- ibis/backends/tests/test_client.py | 25 ------------------- 3 files changed, 5 insertions(+), 54 deletions(-) diff --git a/ibis/backends/risingwave/tests/conftest.py b/ibis/backends/risingwave/tests/conftest.py index 4054e80abf9f..35cfe6b8e1db 100644 --- a/ibis/backends/risingwave/tests/conftest.py +++ b/ibis/backends/risingwave/tests/conftest.py @@ -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 @@ -85,7 +72,7 @@ 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, @@ -93,6 +80,9 @@ def connect(*, tmpdir, worker_id, port: int | None = None, **kw): database=IBIS_TEST_RISINGWAVE_DB, **kw, ) + cursor = con.raw_sql("SET RW_IMPLICIT_FLUSH TO true;") + cursor.close() + return con @pytest.fixture(scope="session") diff --git a/ibis/backends/risingwave/tests/test_client.py b/ibis/backends/risingwave/tests/test_client.py index dfadea36233b..a5b461a9fced 100644 --- a/ibis/backends/risingwave/tests/test_client.py +++ b/ibis/backends/risingwave/tests/test_client.py @@ -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 @@ -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") diff --git a/ibis/backends/tests/test_client.py b/ibis/backends/tests/test_client.py index 2df691fd669d..298a5458188b 100644 --- a/ibis/backends/tests/test_client.py +++ b/ibis/backends/tests/test_client.py @@ -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, @@ -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, @@ -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, @@ -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, @@ -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