sgbaird commited on
Commit
5a16847
·
verified ·
1 Parent(s): 5da60db

return [] if no unused wells

Browse files
Files changed (1) hide show
  1. well_status_utils.py +5 -0
well_status_utils.py CHANGED
@@ -64,6 +64,11 @@ def find_unused_wells():
64
  response = list(collection.find(query))
65
  df = pd.DataFrame(response)
66
 
 
 
 
 
 
67
  # Extract the "well" column as a list
68
  if "well" not in df.columns:
69
  raise ValueError("The returned data does not contain the 'well' field.")
 
64
  response = list(collection.find(query))
65
  df = pd.DataFrame(response)
66
 
67
+ # If no entries at all, just return an empty list
68
+ if df.empty:
69
+ dbclient.close()
70
+ return []
71
+
72
  # Extract the "well" column as a list
73
  if "well" not in df.columns:
74
  raise ValueError("The returned data does not contain the 'well' field.")