gramex icon indicating copy to clipboard operation
gramex copied to clipboard

Alert condition fails for a key different than data

Open bkamapantula opened this issue 5 years ago • 2 comments

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

bkamapantula avatar Feb 27 '19 09:02 bkamapantula

@sanand0 I'd like to take this up please.

bkamapantula avatar Aug 13 '19 12:08 bkamapantula

Sure @bkamapantula. @pratapvardhan can be the first reviewer

sanand0 avatar Aug 13 '19 21:08 sanand0