gramex
gramex copied to clipboard
Alert condition fails for a key different than data
working condition config
alert:
alert-name:
thread: true
data:
data:
url: SQLALCHEMY_STRING
table: users
each: data
condition: data[(data['region'] == 'Region1') & (data['type'] == 'Active')]
to: "{{ row['email'] }}"
subject: Summary
html:
<h3>Hello there {{ row['name'] }}! </h3>
buggy condition config
alert:
alert-name:
thread: true
data:
from_db:
url: SQLALCHEMY_STRING
table: users
each: from_db
condition: from_db[(from_db['region'] == 'Region1') & (from_db['type'] == 'Active')]
to: "{{ row['email'] }}"
subject: Summary
html:
<h3>Hello there {{ row['name'] }}! </h3>
Change in configs: data
is from_db
in second config. The condition fails if the attribute is anything other than data
@sanand0 I'd like to take this up please.
Sure @bkamapantula. @pratapvardhan can be the first reviewer