def post_session(self, session, notify=False):
        job = session.job
        status = job.status()
        if session.name:
            title = "{0}: Job ID {1} {2}".format(session.name, session.job_id, status)
        else:
            title = "Job ID {0} {1}".format(session.job_id, status)
        params = {
            'fallback': title,
            'title': title,
            'title_link': job.url,
            # the first line of query
            'text': job.query.split('\n')[0],
        }
        # author
        if self.author:
            digest = hashlib.md5(self.author.strip().lower().encode('ascii')).hexdigest()
            params['author_name'] = self.author
            params['author_icon'] = 'http://www.gravatar.com/avatar/' + digest
        fields = []
        # duration
        if session.job_start_at:
            job_duration = session.job_end_at - session.job_start_at
            fields.append({
                'title': 'Job Start',
                'value': str(session.job_start_at),
                'short': True,
            })
            fields.append({
                'title': 'Duration',
                'value': str(job_duration),
                'short': True,
            })
        # download
        if session.download_start_at and session.download_end_at:
            download_duration = session.download_start_at - session.download_end_at
            fields.append({
                'title': 'Download Start',
                'value': str(session.download_start_at),
                'short': True,
            })
            fields.append({
                'title': 'Duration',
                'value': str(download_duration),
                'short': True,
            })
        # fields
        params['fields'] = fields
        if status == 'running':
            params['color'] = 'warning'
        elif status == 'success':
            params['color'] = 'good'
        else:
            params['color'] = 'danger'
            params['text'] = job.debug['stderr']
        self.post(attachment=params)
dataset/ETHPy150Open treasure-data/pandas-td/pandas_td/drivers/slack.py/SlackNotifier.post_session/swapped operands of `-`