Commit e96c6484 authored by lintangsutawika's avatar lintangsutawika
Browse files

allow doc_to_choice to be a single feature from a dataset

parent cd4ef5e8
...@@ -936,7 +936,10 @@ class ConfigurableTask(Task): ...@@ -936,7 +936,10 @@ class ConfigurableTask(Task):
doc_to_choice = self.config.doc_to_choice doc_to_choice = self.config.doc_to_choice
if type(doc_to_choice) == str: if type(doc_to_choice) == str:
return ast.literal_eval(utils.apply_template(doc_to_choice, doc)) if doc_to_choice in self.features:
return doc[doc_to_choice]
else:
return ast.literal_eval(utils.apply_template(doc_to_choice, doc))
elif type(doc_to_choice) == list: elif type(doc_to_choice) == list:
return doc_to_choice return doc_to_choice
elif type(doc_to_choice) == dict: elif type(doc_to_choice) == dict:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment