Taragolis commented on code in PR #38079:
URL: https://github.com/apache/airflow/pull/38079#discussion_r1523002335
##########
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:
If we would like to have multiple options we might make it as enum or
literal string because action non-binary.
I would prefer literal, it just a string which wouldn't have any problem
with serde.
```python
from typing_extensions import Literal
...
action_on_empty_df: Literal["send", "skip", "error", "ignore"] = "send"
```
- `send` - send even empty
- `skip` - raise AirflowSkipException, and task will skiped
- `error` - raise an error
- `ignore` - do nothing
--
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]