Skip to content

Commit 39f0af9

Browse files
committed
Fixed as per review comments
1 parent 377b455 commit 39f0af9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ibis-server/app/model/metadata/snowflake.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _transform_column_type(self, data_type):
142142
"smallint": WrenEngineColumnType.SMALLINT,
143143
"tinyint": WrenEngineColumnType.TINYINT,
144144
"byteint": WrenEngineColumnType.TINYINT,
145-
# Decimal
145+
# Float
146146
"float4": WrenEngineColumnType.FLOAT4,
147147
"float": WrenEngineColumnType.FLOAT8,
148148
"float8": WrenEngineColumnType.FLOAT8,

ibis-server/tests/routers/v2/connector/test_snowflake.py

+21
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,27 @@ def test_metadata_list_tables():
267267
json={"connectionInfo": connection_info},
268268
)
269269
assert response.status_code == 200
270+
tables = response.json()
271+
assert len(tables) == 8
272+
table = next(filter(lambda t: t["name"] == "TPCH_SF1.ORDERS", tables))
273+
assert table["name"] == "TPCH_SF1.ORDERS"
274+
assert table["primaryKey"] is not None
275+
assert table["description"] == "Orders data as defined by TPC-H"
276+
assert table["properties"] == {
277+
"catalog": "SNOWFLAKE_SAMPLE_DATA",
278+
"schema": "TPCH_SF1",
279+
"table": "ORDERS",
280+
}
281+
assert len(table["columns"]) == 9
282+
column = next(filter(lambda c: c["name"] == "O_COMMENT", table["columns"]))
283+
assert column == {
284+
"name": "O_COMMENT",
285+
"nestedColumns": None,
286+
"type": "TEXT",
287+
"notNull": True,
288+
"description": None,
289+
"properties": None,
290+
}
270291

271292
def test_metadata_list_constraints():
272293
response = client.post(

0 commit comments

Comments
 (0)