[GitHub] [airflow] potiuk commented on a change in pull request #21403: Update `template_fields_renderers` using new SQL lexers to "sql" renderer

2022-02-07 Thread GitBox


potiuk commented on a change in pull request #21403:
URL: https://github.com/apache/airflow/pull/21403#discussion_r801100375



##
File path: airflow/providers/amazon/aws/operators/redshift_sql.py
##
@@ -44,7 +44,8 @@ class RedshiftSQLOperator(BaseOperator):
 
 template_fields: Sequence[str] = ('sql',)
 template_ext: Sequence[str] = ('.sql',)
-template_fields_renderers = {"sql": "postgresql"}
+# TODO: Update ``sql`` renderer to "postgresql" when the lexer is 
available in Airflow 2.3.0.
+template_fields_renderers = {"sql": "sql"}

Review comment:
   something like that should work :)




-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] potiuk commented on a change in pull request #21403: Update `template_fields_renderers` using new SQL lexers to "sql" renderer

2022-02-07 Thread GitBox


potiuk commented on a change in pull request #21403:
URL: https://github.com/apache/airflow/pull/21403#discussion_r801100269



##
File path: airflow/providers/amazon/aws/operators/redshift_sql.py
##
@@ -44,7 +44,8 @@ class RedshiftSQLOperator(BaseOperator):
 
 template_fields: Sequence[str] = ('sql',)
 template_ext: Sequence[str] = ('.sql',)
-template_fields_renderers = {"sql": "postgresql"}
+# TODO: Update ``sql`` renderer to "postgresql" when the lexer is 
available in Airflow 2.3.0.
+template_fields_renderers = {"sql": "sql"}

Review comment:
   ```suggestion
   template_fields_renderers = {"sql": "postgresql"} if  'postgresql' in 
get_attr_renderer() else {"sql": "sql"}
   ```




-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [airflow] potiuk commented on a change in pull request #21403: Update `template_fields_renderers` using new SQL lexers to "sql" renderer

2022-02-07 Thread GitBox


potiuk commented on a change in pull request #21403:
URL: https://github.com/apache/airflow/pull/21403#discussion_r801098384



##
File path: airflow/providers/amazon/aws/operators/redshift_sql.py
##
@@ -44,7 +44,8 @@ class RedshiftSQLOperator(BaseOperator):
 
 template_fields: Sequence[str] = ('sql',)
 template_ext: Sequence[str] = ('.sql',)
-template_fields_renderers = {"sql": "postgresql"}
+# TODO: Update ``sql`` renderer to "postgresql" when the lexer is 
available in Airflow 2.3.0.

Review comment:
   I  think it would be better to dynamically check the renderers available 
in this case. Otherwise, even if we release 2.3.0, we will not be able to 
change it as the providers are 2.1.0+ 




-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org