Skip to content

Commit

Permalink
better query logging
Browse files Browse the repository at this point in the history
  • Loading branch information
adonm authored May 24, 2023
1 parent b55b8c3 commit b95da3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nbdev_squ/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def hunt(indicators, expression="has", columns=columns, workspaces=None, timespa
if expression not in ['has_all']:
indicator = f"'{indicator}'" # wrap indicator in quotes unless expecting dynamic
if not querylogged:
logger.info(f"Test Query: find where {columns[0]} {expression} '{indicators[0]}' | take {take}")
querylogged=True
logger.info(f"Test Query: find where {columns[0]} {expression} {indicator} | take {take}")
querylogged = True
for chunk in chunks([f"{column} {expression} {indicator}" for column in columns], 20):
query = " or ".join(chunk)
query = f"find where {query} | take {take} | project pack_=pack_all() | evaluate bag_unpack(pack_)"
Expand Down
4 changes: 2 additions & 2 deletions nbs/01_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@
" if expression not in ['has_all']:\n",
" indicator = f\"'{indicator}'\" # wrap indicator in quotes unless expecting dynamic\n",
" if not querylogged:\n",
" logger.info(f\"Test Query: find where {columns[0]} {expression} '{indicators[0]}' | take {take}\")\n",
" querylogged=True\n",
" logger.info(f\"Test Query: find where {columns[0]} {expression} {indicator} | take {take}\")\n",
" querylogged = True\n",
" for chunk in chunks([f\"{column} {expression} {indicator}\" for column in columns], 20):\n",
" query = \" or \".join(chunk)\n",
" query = f\"find where {query} | take {take} | project pack_=pack_all() | evaluate bag_unpack(pack_)\"\n",
Expand Down

0 comments on commit b95da3d

Please sign in to comment.