Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle missing column in Zoom #1308

Merged
merged 6 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions parsons/zoom/zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ def __handle_nested_json(self, table: Table, column: str, version: int = 1) -> T
Parsons Table
"""
if version == 2:
return Table(table.unpack_list(column=column))
if column in table.columns:
return Table(table.unpack_list(column=column))
else:
return table

return Table(table.unpack_list(column=column)).unpack_dict(
column=f"{column}_0", prepend_value=f"{column}_"
Expand Down Expand Up @@ -470,7 +473,7 @@ def get_past_webinar_poll_metadata(self, webinar_id, version: int = 1) -> Table:

logger.info(f"Retrieved {tbl.num_rows} polls for meeting ID {webinar_id}")

return self.__handle_nested_json(table=tbl, column="prompts", version=version)
return self.__handle_nested_json(table=tbl, column="question_details", version=version)

def get_meeting_poll_results(self, meeting_id) -> Table:
"""
Expand Down
10 changes: 5 additions & 5 deletions test/test_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,10 +873,10 @@ def test_get_past_webinar_poll_metadata(self, m):
"answers": ["Extremely useful"],
"case_sensitive": False,
"name": "How useful was this meeting?",
"prompts": [
"question_details": [
{
"prompt_question": "How are you?",
"prompt_right_answers": ["Good"],
"question": "How are you?",
"answer": ["Good"],
}
],
"rating_max_label": "Extremely Likely",
Expand Down Expand Up @@ -907,8 +907,8 @@ def test_get_past_webinar_poll_metadata(self, m):
"right_answers": ["Good"],
"show_as_dropdown": False,
"type": "single",
"prompts__prompt_question": "How are you?",
"prompts__prompt_right_answers": ["Good"],
"question_details__answer": ["Good"],
"question_details__question": "How are you?",
}
],
)
Expand Down
Loading