You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eladkal (via GitHub)" <gi...@apache.org> on 2023/03/07 12:24:07 UTC

[GitHub] [airflow] eladkal opened a new pull request, #29954: Add option to print SQL operator output to log

eladkal opened a new pull request, #29954:
URL: https://github.com/apache/airflow/pull/29954

   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] josh-fell commented on a diff in pull request #29954: Add option to print SQL operator output to log

Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell commented on code in PR #29954:
URL: https://github.com/apache/airflow/pull/29954#discussion_r1127919881


##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -203,6 +203,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
     :param split_statements: (optional) if split single SQL string into statements. By default, defers
         to the default value in the ``run`` method of the configured hook.
     :param return_last: (optional) return the result of only last statement (default: True).
+    :param print_to_log: (optional) if true operator output will be print to log (default: False).

Review Comment:
   WDYT about naming this param "show_output_in_logs" instead? Same vein for naming as "show_return_value_in_logs" in the `@task` decorator / `PythonOperator`. And, I guess it's not _technically_ printing.



-- 
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-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] josh-fell commented on a diff in pull request #29954: Add option to print SQL operator output to log

Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell commented on code in PR #29954:
URL: https://github.com/apache/airflow/pull/29954#discussion_r1128670804


##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -203,6 +203,8 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
     :param split_statements: (optional) if split single SQL string into statements. By default, defers
         to the default value in the ``run`` method of the configured hook.
     :param return_last: (optional) return the result of only last statement (default: True).
+    :param show_return_value_in_logs: (optional) if true operator output will be print to log.

Review Comment:
   ```suggestion
       :param show_return_value_in_logs: (optional) if true operator output will be printed to the task log.
   ```
   Trivial nit.



-- 
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-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] eladkal merged pull request #29954: Add option to show output of `SQLExecuteQueryOperator` in the log

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal merged PR #29954:
URL: https://github.com/apache/airflow/pull/29954


-- 
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-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] josh-fell commented on a diff in pull request #29954: Add option to print SQL operator output to log

Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell commented on code in PR #29954:
URL: https://github.com/apache/airflow/pull/29954#discussion_r1127919881


##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -203,6 +203,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
     :param split_statements: (optional) if split single SQL string into statements. By default, defers
         to the default value in the ``run`` method of the configured hook.
     :param return_last: (optional) return the result of only last statement (default: True).
+    :param print_to_log: (optional) if true operator output will be print to log (default: False).

Review Comment:
   WDYT about naming this param "show_output_in_logs" instead? Same vein for naming as "show_return_value_in_logs" as the `@task` decorator. And, I guess it's not _technically_ printing.



##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -203,6 +203,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
     :param split_statements: (optional) if split single SQL string into statements. By default, defers
         to the default value in the ``run`` method of the configured hook.
     :param return_last: (optional) return the result of only last statement (default: True).
+    :param print_to_log: (optional) if true operator output will be print to log (default: False).

Review Comment:
   Maybe it's also worth mentioning to use some caution because this _could_ return a large amount of data to be exposed in the task logs too?



-- 
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-unsubscribe@airflow.apache.org

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


[GitHub] [airflow] josh-fell commented on a diff in pull request #29954: Add option to print SQL operator output to log

Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell commented on code in PR #29954:
URL: https://github.com/apache/airflow/pull/29954#discussion_r1127919881


##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -203,6 +203,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
     :param split_statements: (optional) if split single SQL string into statements. By default, defers
         to the default value in the ``run`` method of the configured hook.
     :param return_last: (optional) return the result of only last statement (default: True).
+    :param print_to_log: (optional) if true operator output will be print to log (default: False).

Review Comment:
   WDYT about naming this param "show_output_in_logs" instead? Same vein for naming as "show_return_value_in_logs" as the `@task` decorator\`PythonOperator`. And, I guess it's not _technically_ printing.



##########
airflow/providers/common/sql/operators/sql.py:
##########
@@ -203,6 +203,7 @@ class SQLExecuteQueryOperator(BaseSQLOperator):
     :param split_statements: (optional) if split single SQL string into statements. By default, defers
         to the default value in the ``run`` method of the configured hook.
     :param return_last: (optional) return the result of only last statement (default: True).
+    :param print_to_log: (optional) if true operator output will be print to log (default: False).

Review Comment:
   WDYT about naming this param "show_output_in_logs" instead? Same vein for naming as "show_return_value_in_logs" as the `@task` decorator / `PythonOperator`. And, I guess it's not _technically_ printing.



-- 
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-unsubscribe@airflow.apache.org

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