Skip to content

Commit

Permalink
Fixed as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ongdisheng committed Nov 11, 2024
1 parent 377b455 commit 39f0af9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ibis-server/app/model/metadata/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _transform_column_type(self, data_type):
"smallint": WrenEngineColumnType.SMALLINT,
"tinyint": WrenEngineColumnType.TINYINT,
"byteint": WrenEngineColumnType.TINYINT,
# Decimal
# Float
"float4": WrenEngineColumnType.FLOAT4,
"float": WrenEngineColumnType.FLOAT8,
"float8": WrenEngineColumnType.FLOAT8,
Expand Down
21 changes: 21 additions & 0 deletions ibis-server/tests/routers/v2/connector/test_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,27 @@ def test_metadata_list_tables():
json={"connectionInfo": connection_info},
)
assert response.status_code == 200
tables = response.json()
assert len(tables) == 8
table = next(filter(lambda t: t["name"] == "TPCH_SF1.ORDERS", tables))
assert table["name"] == "TPCH_SF1.ORDERS"
assert table["primaryKey"] is not None
assert table["description"] == "Orders data as defined by TPC-H"
assert table["properties"] == {
"catalog": "SNOWFLAKE_SAMPLE_DATA",
"schema": "TPCH_SF1",
"table": "ORDERS",
}
assert len(table["columns"]) == 9
column = next(filter(lambda c: c["name"] == "O_COMMENT", table["columns"]))
assert column == {
"name": "O_COMMENT",
"nestedColumns": None,
"type": "TEXT",
"notNull": True,
"description": None,
"properties": None,
}

def test_metadata_list_constraints():
response = client.post(
Expand Down

0 comments on commit 39f0af9

Please sign in to comment.