Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug / ThresholdCheckOperator Does Not Work #9309

Closed
DanilBaibak opened this issue Jun 15, 2020 · 2 comments
Closed

Bug / ThresholdCheckOperator Does Not Work #9309

DanilBaibak opened this issue Jun 15, 2020 · 2 comments
Labels
kind:bug This is a clearly a bug

Comments

@DanilBaibak
Copy link
Contributor

Apache Airflow version: 1.10.10

Environment:

What happened:
I tried to use ThresholdCheckOperator:

check_amount_value = ThresholdCheckOperator(
    task_id='check_amount_value',
    sql='SELECT MAX(amount) FROM interaction WHERE interaction_date=CURRENT_DATE',
    max_threshold=1500,
    min_threshold=1100,
    conn_id=CONN_ID
)

I caught such error:

[2020-06-15 13:49:25,639] {taskinstance.py:1145} ERROR - 'int' object is not subscriptable
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 983, in _run_raw_task
    result = task_copy.execute(context=context)
  File "/usr/local/lib/python3.7/site-packages/airflow/operators/check_operator.py", line 375, in execute
    result = hook.get_first(self.sql)[0][0]
TypeError: 'int' object is not subscriptable

What you expected to happen:
I expected that the check will be passed without any error.

How to reproduce it:
Here is the dockerized application, where I played around with all available checks. All check operators work correctly except ThresholdCheckOperator.

@DanilBaibak DanilBaibak added the kind:bug This is a clearly a bug label Jun 15, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 15, 2020

Thanks for opening your first issue here! Be sure to follow the issue template!

@DanilBaibak
Copy link
Contributor Author

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

1 participant