uranusjr commented on a change in pull request #17247:
URL: https://github.com/apache/airflow/pull/17247#discussion_r679680023
##########
File path: airflow/providers/slack/operators/slack.py
##########
@@ -161,16 +161,26 @@ class SlackAPIFileOperator(SlackAPIOperator):
.. code-block:: python
- slack = SlackAPIFileOperator(
- task_id="slack_file_upload",
- dag=dag,
- slack_conn_id="slack",
- channel="#general",
- initial_comment="Hello World!",
- filename="hello_world.csv",
- filetype="csv",
- content="hello,world,csv,file",
- )
+ # Send file with filename and filetype
+ slack = SlackAPIFileOperator(
+ task_id="slack_file_upload",
+ dag=dag,
+ slack_conn_id="slack",
+ channel="#general",
+ initial_comment="Hello World!",
+ filename="hello_world.csv",
+ filetype="csv"
+ )
+
+ # Send file content
+ slack = SlackAPIFileOperator(
+ task_id="slack_file_upload",
+ dag=dag,
+ slack_conn_id="slack",
+ channel="#general",
+ initial_comment="Hello World!",
+ content="file content in txt",
+ )
Review comment:
This is also indented wrong. (Sorry about being picky; people are known
to copy-paste the examples and this would be very annoying.)
```suggestion
# Send file with filename and filetype
slack = SlackAPIFileOperator(
task_id="slack_file_upload",
dag=dag,
slack_conn_id="slack",
channel="#general",
initial_comment="Hello World!",
filename="hello_world.csv",
filetype="csv"
)
# Send file content
slack = SlackAPIFileOperator(
task_id="slack_file_upload",
dag=dag,
slack_conn_id="slack",
channel="#general",
initial_comment="Hello World!",
content="file content in txt",
)
```
--
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]