andyguwc commented on code in PR #38079:
URL: https://github.com/apache/airflow/pull/38079#discussion_r1523617708


##########
airflow/providers/slack/transfers/sql_to_slack.py:
##########
@@ -134,6 +141,8 @@ def execute(self, context: Context) -> None:
             output_file_name = fp.name
             output_file_format = output_file_format.upper()
             df_result = self._get_query_results()
+            if not self.allow_null and df_result.empty:
+                raise SqlToSlackNullOutputException("Sql output is empty.")

Review Comment:
   good suggestions - I updated the param with the following possible values. 
This maps 1:1 with the task state. Should be straightforward enough for the end 
user to understand.
   
   ```
   :param action_on_empty_df: Specifying how to handle an empty sql output df. 
Possible values:
           - ``send``: (default) send the slack with an empty file.
           - ``skip``: skip sending the slack message. Task state set to 
"skipped".
           - ``error``: raise an error to fail the task. Task state set to 
"failed".
   ```



-- 
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]

Reply via email to