acryl-datahub 1.0.0.4rc6__py3-none-any.whl → 1.0.0.4rc8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of acryl-datahub might be problematic. Click here for more details.
- {acryl_datahub-1.0.0.4rc6.dist-info → acryl_datahub-1.0.0.4rc8.dist-info}/METADATA +2471 -2471
- {acryl_datahub-1.0.0.4rc6.dist-info → acryl_datahub-1.0.0.4rc8.dist-info}/RECORD +21 -21
- datahub/_version.py +1 -1
- datahub/ingestion/source/cassandra/cassandra_api.py +20 -0
- datahub/ingestion/source/cassandra/cassandra_config.py +15 -0
- datahub/ingestion/source/hex/hex.py +6 -1
- datahub/ingestion/source/hex/query_fetcher.py +1 -0
- datahub/ingestion/source/mode.py +232 -157
- datahub/ingestion/source/sql/mssql/source.py +31 -0
- datahub/ingestion/source/sql/presto.py +18 -1
- datahub/ingestion/source/sql/trino.py +28 -6
- datahub/metadata/_internal_schema_classes.py +476 -476
- datahub/metadata/_urns/urn_defs.py +1703 -1703
- datahub/metadata/schema.avsc +16229 -16229
- datahub/metadata/schemas/__init__.py +3 -3
- datahub/sql_parsing/sql_parsing_aggregator.py +17 -1
- datahub/sql_parsing/sqlglot_lineage.py +220 -9
- {acryl_datahub-1.0.0.4rc6.dist-info → acryl_datahub-1.0.0.4rc8.dist-info}/WHEEL +0 -0
- {acryl_datahub-1.0.0.4rc6.dist-info → acryl_datahub-1.0.0.4rc8.dist-info}/entry_points.txt +0 -0
- {acryl_datahub-1.0.0.4rc6.dist-info → acryl_datahub-1.0.0.4rc8.dist-info}/licenses/LICENSE +0 -0
- {acryl_datahub-1.0.0.4rc6.dist-info → acryl_datahub-1.0.0.4rc8.dist-info}/top_level.txt +0 -0
|
@@ -134,19 +134,41 @@ def get_table_comment(self, connection, table_name: str, schema: str = None, **k
|
|
|
134
134
|
):
|
|
135
135
|
properties_table = self._get_full_table(f"{table_name}$properties", schema)
|
|
136
136
|
query = f"SELECT * FROM {properties_table}"
|
|
137
|
-
|
|
137
|
+
rows = connection.execute(sql.text(query)).fetchall()
|
|
138
138
|
|
|
139
139
|
# Generate properties dictionary.
|
|
140
140
|
properties = {}
|
|
141
|
-
|
|
141
|
+
|
|
142
|
+
if len(rows) == 0:
|
|
143
|
+
# No properties found, return empty dictionary
|
|
144
|
+
return {}
|
|
145
|
+
|
|
146
|
+
# Check if using the old format (key, value columns)
|
|
147
|
+
if (
|
|
148
|
+
connector_name == "iceberg"
|
|
149
|
+
and len(rows[0]) == 2
|
|
150
|
+
and "key" in rows[0]
|
|
151
|
+
and "value" in rows[0]
|
|
152
|
+
):
|
|
153
|
+
# https://trino.io/docs/current/connector/iceberg.html#properties-table
|
|
154
|
+
for row in rows:
|
|
155
|
+
if row["value"] is not None:
|
|
156
|
+
properties[row["key"]] = row["value"]
|
|
157
|
+
return {"text": properties.get("comment"), "properties": properties}
|
|
158
|
+
elif connector_name == "hive" and len(rows[0]) > 1 and len(rows) == 1:
|
|
159
|
+
# https://trino.io/docs/current/connector/hive.html#properties-table
|
|
160
|
+
row = rows[0]
|
|
142
161
|
for col_name, col_value in row.items():
|
|
143
162
|
if col_value is not None:
|
|
144
163
|
properties[col_name] = col_value
|
|
164
|
+
return {"text": properties.get("comment"), "properties": properties}
|
|
145
165
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
166
|
+
# If we can't get the properties we still fallback to the default
|
|
167
|
+
return self.get_table_comment_default(connection, table_name, schema)
|
|
168
|
+
except Exception as e:
|
|
169
|
+
logging.warning(
|
|
170
|
+
f"Failed to get table comment for {table_name} in {schema}: {e}"
|
|
171
|
+
)
|
|
150
172
|
return {}
|
|
151
173
|
|
|
152
174
|
|