Skip to content

Commit 74caf04

Browse files
committed
Merge branch 'inventory_bug_fix'
2 parents 3382f0d + b16fa73 commit 74caf04

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

code/util/fetch_data_docDB.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ def fetch_single_query(query, pagination, paginate_batch_size):
255255
# --- Process data into dataframe ---
256256
df = pd.json_normalize(results)
257257

258+
def to_list(x):
259+
if x is None or (isinstance(x, float) and pd.isna(x)):
260+
return None
261+
return x if isinstance(x, (list, tuple)) else [str(x)]
262+
263+
df["session.experimenter_full_name"] = df["session.experimenter_full_name"].apply(
264+
to_list)
265+
258266
# Formatting dataframe
259267
df, df_unique_mouse_date, df_multi_sessions_per_day = formatting_metadata_df(df)
260268
df_unique_mouse_date[query["alias"]] = True # Add a column to prepare for merging

0 commit comments

Comments
 (0)