Skip to content

Commit

Permalink
return empty dataframe instead of dict
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieRoald committed May 7, 2024
1 parent 41c6ce9 commit 510997d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dhlab/api/dhlab_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def concordance(
:return: a table of concordances
"""
if words is None:
return {} # exit condition
return pd.DataFrame(columns=["index", "docid", "urn", "conc"]) # exit condition
else:
params = {"urns": urns, "query": words, "window": window, "limit": limit}
r = requests.post(BASE_URL + "/conc", json=params)
Expand All @@ -728,7 +728,7 @@ def concordance_counts(
:return: a table of counts
"""
if words is None:
return {} # exit condition
return pd.DataFrame(columns=["freq"]) # exit condition
else:
params = {"urns": urns, "query": words, "window": window, "limit": limit}
r = requests.post(BASE_URL + "/conccount", json=params)
Expand Down

0 comments on commit 510997d

Please sign in to comment.