-
Notifications
You must be signed in to change notification settings - Fork 66
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): added primary key management on postgres and updated mssql and mysql to manage composite keys #1106
base: main
Are you sure you want to change the base?
Changes from all commits
e159f5a
0b5eb0a
bfcd4ed
8076da8
7bcce3b
dbff7d8
592ed28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ | |
"type": "timestamp", | ||
}, | ||
], | ||
"primaryKey": "orderkey", | ||
"primaryKey": ["orderkey"], | ||
}, | ||
], | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
"type": "varchar", | ||
}, | ||
], | ||
"primaryKey": "orderkey", | ||
"primaryKey": ["orderkey"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify all test assertions are compatible with the new primary key format. While the primary key format changes look good, it's important to ensure that any assertions or validations in the test suite that might reference these primary keys are also updated to expect lists instead of strings. Also applies to: 69-69 🏁 Script executed: #!/bin/bash
# Scan for assertions or validations that might expect primaryKey to be a string
rg -A 5 -B 5 "primaryKey" --glob "*.py" | grep -E "assert|test" | grep -v "\[\".*\"\]" Length of output: 30078 Attention: Update Test Assertions for Primary Key Format Change The primary key update in
Please update the tests accordingly to prevent potential mismatches and unexpected behavior during test execution. |
||
}, | ||
{ | ||
"name": "Customer", | ||
|
@@ -66,7 +66,7 @@ | |
"expression": "sum(orders.totalprice)", | ||
}, | ||
], | ||
"primaryKey": "custkey", | ||
"primaryKey": ["custkey"], | ||
}, | ||
], | ||
"relationships": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ | |
"type": "bytea", | ||
}, | ||
], | ||
"primaryKey": "orderkey", | ||
"primaryKey": ["orderkey"], | ||
}, | ||
], | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ | |
"type": "blob", | ||
}, | ||
], | ||
"primaryKey": "orderkey", | ||
"primaryKey": ["orderkey"], | ||
} | ||
], | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ | |
"type": "timestamp", | ||
}, | ||
], | ||
"primaryKey": "orderkey", | ||
"primaryKey": ["orderkey"], | ||
}, | ||
], | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ | |
"type": "bytea", | ||
}, | ||
], | ||
"primaryKey": "orderkey", | ||
"primaryKey": ["orderkey"], | ||
}, | ||
], | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
"type": "timestamptz", | ||
}, | ||
], | ||
"primaryKey": "o_orderkey", | ||
"primaryKey": ["o_orderkey"], | ||
}, | ||
], | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Initialization changed but no logic to populate primary keys
The change from initializing
primaryKey
as a string to a list is consistent with the modifications in other database metadata classes to support composite keys. However, unlike the MSSQL, MySQL, and PostgreSQL implementations mentioned in the PR objectives, there's no logic in this file to populate theprimaryKey
list with actual primary key column names.This change may be incomplete without corresponding logic to populate the primary key list. Please verify if Trino supports retrieving primary key information and, if so, update either the SQL query in
get_table_list
or implement theget_constraints
method to populate theprimaryKey
list. This might be related to the test failures mentioned in the PR comments fortest_trino.py
.🏁 Script executed:
Length of output: 20170
Action Required: Address Missing Primary Key Population for TRINO
The TRINO metadata module now initializes
primaryKey
as an empty list—which aligns with the recent changes in other drivers—but, unlike the MSSQL, MySQL, and PostgreSQL implementations, there is no logic to populate this list with actual primary key column names. The search confirms that while other modules append toprimaryKey
(e.g., via their respectiveget_constraints
methods), the TRINO module lacks any similar population strategy. This may be contributing to the test failures intest_trino.py
.get_table_list
or implement aget_constraints
method to append the primary key column data.