Skip to content

Commit 031072b

Browse files
committed
add current options to csv return
1 parent 60adb93 commit 031072b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

utils/csv_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ def generate_data(
329329
+ "**`Default Project ID`** - the id of the default project for the Post.\n"
330330
+ "**`Label`** - for a group question, this is the sub-question object.\n"
331331
+ "**`Question Type`** - the type of the question. Binary, Multiple Choice, Numeric, Discrete, or Date.\n"
332+
+ "**`MC Options (Current)`** - the current options for a multiple choice question, if applicable.\n"
332333
+ "**`MC Options (All)`** - the options for a multiple choice question across all time, if applicable.\n"
333334
+ "**`MC Options History`** - the history of options over time. Each entry is a timestamp and a record of what the options were at that time.\n"
334335
+ "**`Lower Bound`** - the lower bound of the forecasting range for a continuous question.\n"
@@ -359,6 +360,7 @@ def generate_data(
359360
"Default Project ID",
360361
"Label",
361362
"Question Type",
363+
"MC Options (Current)",
362364
"MC Options (All)",
363365
"MC Options History",
364366
"Lower Bound",
@@ -409,7 +411,12 @@ def format_value(val):
409411
post.default_project_id,
410412
question.label,
411413
question.type,
412-
get_all_options_from_history(question.options_history),
414+
question.options,
415+
(
416+
get_all_options_from_history(question.options_history)
417+
if question.options_history
418+
else None
419+
),
413420
question.options_history or None,
414421
format_value(question.range_min),
415422
question.open_lower_bound,

0 commit comments

Comments
 (0)