Skip to content

Commit

Permalink
misc logs for prod debuging
Browse files Browse the repository at this point in the history
  • Loading branch information
BryceStevenWilley committed Jun 4, 2022
1 parent a67d673 commit bc27f36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docassemble/tclpgoogledocsmerger/airtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def get_airtable(
) -> Optional[pd.DataFrame]:
"""Gets the airtable into the same dataframe that we would read it from a CSV"""
just_rows = get_airtable_or_cache(airtable_info, redis_cache)
log(f"get_airtable: just_rows: {just_rows}")
if not just_rows:
return None
df = pd.DataFrame(just_rows)
Expand Down Expand Up @@ -73,6 +74,7 @@ def get_airtable_or_cache(airtable_info:Mapping[str, str], redis_cache=None) ->
my_airtable = Table(airtable_key, airtable_base, airtable_table)
all_table = my_airtable.all()
just_rows = [row['fields'] for row in all_table]
log(f"just_rows pre comboing: {just_rows}")
for col, table_name in reference_cols:
t = Table(airtable_key, airtable_base, table_name)
name_map = {r["id"]: r["fields"].get("Name") for r in t.all()}
Expand All @@ -85,4 +87,5 @@ def get_airtable_or_cache(airtable_info:Mapping[str, str], redis_cache=None) ->
if redis_cache:
new_data = {'last_updated': current_datetime(), 'contents': just_rows}
redis_cache.set_data(redis_key, new_data)
log(f"just_rows post comboing: {just_rows}")
return just_rows
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ code: |
selected_vals = {}
for col, label, tooltip, is_top_level in separate_column_info:
vals_for_columns[col] = multi_index.get_values(col)
log(f("vals_for_columns[{col}]: {vals_for_columns[col]}")
field_info = {'label': label, 'field': f'selected_vals["{col}"]',
'datatype': 'multiselect',
'required': False, 'code': f'vals_for_columns["{col}"]'}
Expand Down

0 comments on commit bc27f36

Please sign in to comment.