Skip to content

Commit

Permalink
added etk query
Browse files Browse the repository at this point in the history
  • Loading branch information
amlanc1 committed Nov 23, 2023
1 parent 6148d5c commit b63a702
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/reconfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ def recondestination(dbclient,main_staging_collection,main_table_collection,reco
table_name=(lambda x: bi_geo_table if x['eventType']=='geolocation' else bi_table_name)(row)
# table_name = bi_table_name
reconqrystr = f'SELECT * FROM {table_name} WHERE {mainqrystr}'
logging.debug(f'here is the query string for main table: {reconqrystr}')
logger.debug(f'here is the query string for main table: {reconqrystr}')
mainfound = bi_sql_db_obj.reconQuery(reconqrystr,logger)
if eventpayload:
eventqrystr = bi_sql_db_obj.prepQuerystr(eventpayload,row['datasource'])
table_name = bi_events_table_name
reconqrystr = f'SELECT * FROM {table_name} WHERE {eventqrystr}'
logging.debug(f'here is the query string for event table: {reconqrystr}')
logger.debug(f'here is the query string for event table: {reconqrystr}')
eventfound = bi_sql_db_obj.reconQuery(reconqrystr,logger)
else:
eventfound=True
Expand All @@ -104,7 +104,7 @@ def recondestination(dbclient,main_staging_collection,main_table_collection,reco
print(countsqrystr)
table_name = bi_violations_table_name
reconqrystr = f'SELECT * FROM {table_name} WHERE {countsqrystr}'
logging.debug(f'here is the query string for counts table: {reconqrystr}')
logger.debug(f'here is the query string for counts table: {reconqrystr}')
countsfound = bi_sql_db_obj.reconQuery(reconqrystr,logger)
if not countsfound:
break
Expand All @@ -114,7 +114,7 @@ def recondestination(dbclient,main_staging_collection,main_table_collection,reco
eventqrystr = bi_sql_db_obj.prepQuerystr(geopayload, row['datasource'])
table_name = bi_geo_table
reconqrystr = f'SELECT * FROM {table_name} WHERE {eventqrystr}'
logging.debug(f'here is the query string for geo table: {reconqrystr}')
logger.debug(f'here is the query string for geo table: {reconqrystr}')
geofound = bi_sql_db_obj.reconQuery(reconqrystr, logger)
else:
geofound=True
Expand Down

0 comments on commit b63a702

Please sign in to comment.