Skip to content

Commit

Permalink
fix(trino): fix incorrect version computation
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed May 22, 2023
1 parent bf6eeab commit 04d3a89
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ibis/backends/trino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import warnings
from functools import cached_property
from typing import Iterator

import sqlalchemy as sa
Expand All @@ -26,12 +27,10 @@ class Backend(BaseAlchemyBackend):
def current_database(self) -> str:
raise NotImplementedError(type(self))

@property
@cached_property
def version(self) -> str:
# TODO: there is a `PRAGMA version` we could use instead
import importlib.metadata

return importlib.metadata.version("trino")
with self.begin() as con:
return con.execute(sa.select(sa.func.version())).scalar()

def do_connect(
self,
Expand Down

0 comments on commit 04d3a89

Please sign in to comment.