Skip to content

Commit

Permalink
test(trino): make sure uri connect test does not rely on backend data (
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed May 25, 2024
1 parent 582165f commit b30916e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ibis/backends/trino/tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import math
import os
import string

import pytest
Expand Down Expand Up @@ -187,12 +186,11 @@ def test_list_tables_schema_warning_refactor(con):


def test_connect_uri():
TRINO_USER = os.getenv("IBIS_TEST_TRINO_USER", os.getenv("TRINO_USER", "user"))
TRINO_PASS = os.getenv("IBIS_TEST_TRINO_PASSWORD", os.getenv("TRINO_PASSWORD", ""))
TRINO_HOST = os.getenv("IBIS_TEST_TRINO_HOST", os.getenv("TRINO_HOST", "localhost"))
TRINO_PORT = int(os.getenv("IBIS_TEST_TRINO_PORT", os.getenv("TRINO_PORT", "8080")))
con = ibis.connect(
f"trino://{TRINO_USER}:{TRINO_PASS}@{TRINO_HOST}:{TRINO_PORT}/memory/default"
)

assert con.list_tables()
result = con.sql("SELECT 1 AS a, 'b' AS b").to_pandas()

assert result.iat[0, 0] == 1
assert result.iat[0, 1] == "b"

0 comments on commit b30916e

Please sign in to comment.