0

I'm trying to have my IF statement execute on a pandas dataframe column that does not contain ONLINE in the column. Here is the snippet from my script:

if ~sql_query_qa['Status'].str.contains('ONLINE').any():
    print("\nA STAGING DATABASE IS NOT ONLINE\n")
    status = ("A STAGING DATABASE IS NOT ONLINE")
    email(status)

Here is the sql_query_qa Dataframe that contains OFFLINE in the column:

             DB   Status
0        TESTDB   ONLINE
1      AIM_TEST   ONLINE
2    FC_DB_TEST   ONLINE
3          WUDM   ONLINE
4  SCRPTSA_TEST   ONLINE
5       SCRPTSA   ONLINE
6        SAKILA  OFFLINE

Status can include other status' other than OFFLINE and ONLINE which is why I did not specify a CONTAINS OFFLINE in the statement.

Any idea where I'm going wrong?

Brad
  • 3,307
  • 2
  • 20
  • 43
Dennis
  • 15
  • 4

0 Answers0