Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ibis): Display Snowflake constraints without memtable #957

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions ibis-server/app/model/metadata/snowflake.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from contextlib import closing

import ibis

from app.model import SnowflakeConnectionInfo
from app.model.data_source import DataSource
from app.model.metadata.dto import (
Expand Down Expand Up @@ -83,12 +81,7 @@ def get_constraints(self) -> list[Constraint]:
"""
with closing(self.connection.raw_sql(sql)) as cur:
fields = [field[0] for field in cur.description]
result = [dict(zip(fields, row)) for row in cur.fetchall()]
res = (
ibis.memtable(result).to_pandas().to_dict(orient="records")
if len(result) > 0
else []
)
res = [dict(zip(fields, row)) for row in cur.fetchall()]
constraints = []
for row in res:
constraints.append(
Expand Down