You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/10 18:22:28 UTC

[GitHub] [airflow] eladkal commented on pull request #17400: Example dag slackfile

eladkal commented on pull request #17400:
URL: https://github.com/apache/airflow/pull/17400#issuecomment-896213783


   @subkanthi it's probably related because the failing tests are of Slack
   
   ```
   =================================== FAILURES ===================================
     _________ TestSlackAPIFileOperator.test_api_call_params_with_file_args _________
     
     self = <tests.providers.slack.operators.test_slack.TestSlackAPIFileOperator testMethod=test_api_call_params_with_file_args>
     mock_hook = <MagicMock name='SlackHook' id='139893250056768'>
     
         @mock.patch('airflow.providers.slack.operators.slack.SlackHook')
         def test_api_call_params_with_file_args(self, mock_hook):
             test_slack_conn_id = 'test_slack_conn_id'
         
             slack_api_post_operator = SlackAPIFileOperator(
                 task_id='slack', slack_conn_id=test_slack_conn_id, file='./test.csv', filetype='csv'
             )
         
     >       slack_api_post_operator.execute()
     
     tests/providers/slack/operators/test_slack.py:215: 
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
     
     self = <Task(SlackAPIFileOperator): slack>, kwargs = {}
     slack = <MagicMock name='SlackHook()' id='139893328790136'>
     
         def execute(self, **kwargs):
             """
             The SlackAPIOperator calls will not fail even if the call is not unsuccessful.
             It should not prevent a DAG from completing in success
             """
             slack = SlackHook(token=self.token, slack_conn_id=self.slack_conn_id)
         
             # If file content is passed.
             if self.content is not None:
                 self.api_params = {
                     'channels': self.channel,
                     'content': self.content,
                     'initial_comment': self.initial_comment,
                 }
                 slack.call(self.method, data=self.api_params)
             # If file name is passed.
             elif self.file is not None:
                 self.api_params = {
                     'channels': self.channel,
                     'filename': self.file,
                     'filetype': self.filetype,
                     'initial_comment': self.initial_comment,
                 }
     >           with open(self.file, "rb") as file_name:
     E           FileNotFoundError: [Errno 2] No such file or directory: './test.csv'
     
     airflow/providers/slack/operators/slack.py:242: FileNotFoundError
   ```


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