-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #19232 - Correct array type mapping in ORM converter #19241
Conversation
@@ -76,7 +76,9 @@ def map_types(self, col: Column, table_service_type): | |||
"""returns an ORM type""" | |||
|
|||
if col.arrayDataType: | |||
return self._TYPE_MAP.get(col.dataType)(item_type=col.arrayDataType) | |||
return self._TYPE_MAP.get(col.dataType)( | |||
item_type=self._TYPE_MAP.get(col.arrayDataType) |
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.
we were passing OM's DataType
instead of a real ORM
@@ -94,6 +94,12 @@ def _process_col_type(self, column: dict, schema: str) -> Tuple: | |||
parsed_string["name"] = column["name"] | |||
else: | |||
col_type = ColumnTypeParser.get_column_type(column["type"]) | |||
# For arrays, we'll get the item type if possible, or parse the string representation of the column | |||
# if SQLAlchemy does not provide any further information | |||
if col_type == "ARRAY" and getattr(column["type"], "item_type"): |
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.
we were ignoring the item_type
property if it ever was informed and only relied on the str representation of the types
Quality Gate passed for 'open-metadata-ingestion'Issues Measures |
Describe your changes:
Fixes #19232
Sampler was failing for postgres array types. There were 2 issues:
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>