Skip to content

Commit

Permalink
adding some log statements to demographic table.
Browse files Browse the repository at this point in the history
  • Loading branch information
achasmita committed Oct 20, 2023
1 parent f28cbdb commit 8d9caa6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def query_demographics():
entries = ts.find_entries(["manual/demographic_survey"])
df = pd.json_normalize(list(entries))
if not df.empty:
for col in constants.BINARY_DEMOGRAPHICS_COLS:
if col in df.columns:
df[col] = df[col].apply(str)
for col in df.columns:
if df[col].dtype == 'object':
df[col] = df[col].apply(str)
columns_to_drop = [col for col in df.columns if col.startswith("metadata")]
df.drop(columns= columns_to_drop, inplace=True)
modified_columns = perm_utils.get_demographic_columns(df.columns)
Expand All @@ -119,6 +119,9 @@ def query_demographics():
for col in constants.EXCLUDED_DEMOGRAPHICS_COLS:
if col in df.columns:
df.drop(columns= [col], inplace=True)
logging.debug("After modifying, df columns are %s" % df.columns)
logging.debug("The data in column is %s" %df.head(5))
logging.debug("The data in column is %s" %df["Which_one_below_describe_you_b"])
return df


Expand Down

0 comments on commit 8d9caa6

Please sign in to comment.