Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.

Commit 554e6d7

Browse files
committed
feat: support edger-loading cursor.description
1 parent ec28deb commit 554e6d7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sqlalchemy_trino/result.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ def __init__(self, parent, cursor):
1616
def _load(self):
1717
if self.__delegator is not None:
1818
return
19-
if not self._is_fetched():
19+
if not self.__cursor.description:
2020
raise Exception("Cursor must be loaded before call TrinoResultMetaData")
2121
self.__delegator = ResultMetaData(self.__parent, self.__cursor.description)
2222

23-
def _is_fetched(self):
24-
query: TrinoQuery = self.__cursor._query # noqa
25-
result: TrinoResult = query._result # noqa
26-
return query.is_finished() or result.rownumber > 0
27-
2823
def __getattr__(self, item):
2924
self._load()
3025
return getattr(self.__delegator, item)

0 commit comments

Comments
 (0)