kacpermuda commented on code in PR #50392:
URL: https://github.com/apache/airflow/pull/50392#discussion_r2084278105
##########
devel-common/src/sphinx_exts/providers_extensions.py:
##########
@@ -314,7 +315,12 @@ def _render_openlineage_supported_classes_content():
method_names=openlineage_db_hook_methods,
class_registry=class_registry,
):
- db_type = class_name.replace("SqlApiHook", "").replace("Hook",
"")
+ db_type = ( # Extract db type from hook name
Review Comment:
We need to extract the Db type from hook class name, but it also should be
generic enough to handle new hooks automatically, without additional manual
work. Since hooks are named in a different way (`DatabricksSqlHook`,
`SnowflakeSqlApiHook`, `RedshiftSQLHook`), sometimes the SQL is in the dialect
name and sometimes not (`MySqlHook`, `TrinoHook`), it was the easiest way to
achieve the desired outcome. Just for the record, this is only used in
OpenLineage docs, so has no influence on code execution. When clearing it for
Databricks i also provided a small improvement for other dbs here, but this
does not change the outcome, it's just to make sure we clean the strings
properly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]