Repository: ibis-project/ibis

Issue:
ci(duckdb): flaky `install_extension` call
### What happened?

Occasional flakiness when setting up duckdb extensions, e.g., https://github.com/ibis-project/ibis/actions/runs/5358102004/jobs/9719988674?pr=6518

### What version of ibis are you using?

`master`

### What backend(s) are you using, if any?

DuckDB

### Relevant log output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/ibis/backends/conftest.py b/ibis/backends/conftest.py
--- a/ibis/backends/conftest.py
+++ b/ibis/backends/conftest.py
@@ -313,7 +313,6 @@ def pytest_collection_modifyitems(session, config, items):
             itertools.chain(
                 *(item.iter_markers(name=name) for name in all_backends),
                 item.iter_markers(name="backend"),
-                item.iter_markers(name="backend_nodata"),
             )
         ):
             # anything else is a "core" test and is run by default
@@ -380,9 +379,9 @@ def _get_backends_to_test(
 def pytest_runtest_call(item):
     """Dynamically add various custom markers."""
     backend = [
-        backend.name()
+        getattr(backend, "name", lambda backend=backend: backend)()
         for key, backend in item.funcargs.items()
-        if key.endswith(("backend", "backend_nodata"))
+        if key.endswith(("backend", "backend_name"))
     ]
     if len(backend) > 1:
         raise ValueError(
@@ -408,7 +407,7 @@ def pytest_runtest_call(item):
         con = funcargs.get(
             "con",
             getattr(
-                funcargs.get("backend", funcargs.get("backend_nodata")),
+                funcargs.get("backend"),
                 "connection",
                 None,
             ),
@@ -544,20 +543,6 @@ def con(backend):
     return backend.connection
 
 
-@pytest.fixture(params=_get_backends_to_test(), scope='session')
-def backend_nodata(request, data_directory):
-    """Return an instance of BackendTest, loaded with data."""
-
-    cls = _get_backend_conf(request.param)
-    return cls(data_directory)
-
-
-@pytest.fixture(scope="session")
-def con_nodata(backend_nodata):
-    """Instance of a backend client."""
-    return backend_nodata.connection
-
-
 def _setup_backend(
     request, data_directory, script_directory, tmp_path_factory, worker_id
 ):


Test patch:
diff --git a/ibis/backends/tests/test_sql.py b/ibis/backends/tests/test_sql.py
--- a/ibis/backends/tests/test_sql.py
+++ b/ibis/backends/tests/test_sql.py
@@ -6,6 +6,7 @@
 import ibis
 import ibis.common.exceptions as exc
 from ibis import _
+from ibis.backends.conftest import _get_backends_to_test
 
 sa = pytest.importorskip("sqlalchemy")
 sg = pytest.importorskip("sqlglot")
@@ -158,8 +159,9 @@ def test_isin_bug(con, snapshot):
     raises=sg.ParseError,
     reason="https://github.com/tobymao/sqlglot/pull/1379 not in the installed version of sqlglot",
 )
-def test_union_aliasing(con_nodata, snapshot):
-    if con_nodata.name == "snowflake":
+@pytest.mark.parametrize("backend_name", _get_backends_to_test())
+def test_union_aliasing(backend_name, snapshot):
+    if backend_name == "snowflake":
         pytest.skip(
             "pivot requires random names to make snowflake work properly and cannot be snapshotted"
         )
@@ -207,4 +209,4 @@ def test_union_aliasing(con_nodata, snapshot):
 
     result = top_ten.union(bottom_ten)
 
-    snapshot.assert_match(str(ibis.to_sql(result, dialect=con_nodata.name)), "out.sql")
+    snapshot.assert_match(str(ibis.to_sql(result, dialect=backend_name)), "out.sql")