Programmer-RD-AI commented on code in PR #54475:
URL: https://github.com/apache/airflow/pull/54475#discussion_r2275404363
##########
providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:
##########
@@ -804,10 +806,15 @@ def _make_common_data_structure(self, result: T |
Sequence[T]) -> tuple | list[t
return cast("list[tuple]", result)
return cast("tuple", result)
+ def _truncate_text(self,text):
Review Comment:
```suggestion
def _truncate_text(self,text:str) -> str:
```
lets add type hints for the parameters and return types
##########
providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:
##########
@@ -804,10 +806,15 @@ def _make_common_data_structure(self, result: T |
Sequence[T]) -> tuple | list[t
return cast("list[tuple]", result)
return cast("tuple", result)
+ def _truncate_text(self,text):
+ if self._max_log_sql_str is None or len(text) <= self._max_log_sql_str
+ return text
+ return text[:self._max_log_sql_str] + '.......'
Review Comment:
when we are returning this, i think we should provide a info or a warning
log here mentioning that we are truncating the log and that they can configure
using the `self._max_log_sql_str` variable
##########
providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:
##########
Review Comment:
i think there are some formatting issues, just make sure that you use the
pre commit hooks, thanks
--
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]