Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

fix bug where json_annotation returns a garbage annotation for Optional types #1363

Merged
merged 1 commit into from
Jun 13, 2018
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
2 changes: 1 addition & 1 deletion allennlp/common/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def json_annotation(cla55: Optional[type]):
elif origin == Union:
# Special special case to handle optional types:
if len(args) == 2 and args[-1] == type(None):
return {'origin': json_annotation(args[0])}
return json_annotation(args[0])
else:
return {'origin': "Union", 'args': [json_annotation(arg) for arg in args]}
elif cla55 == Ellipsis:
Expand Down
1 change: 0 additions & 1 deletion allennlp/service/config_explorer.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ <h2>AllenNLP Configuration Wizard (alpha)</h2>
setData(fn) {
const {data} = this.state
const newData = markComplete(fn(data))
console.log(newData)
return this.setState({data: newData})
}

Expand Down
1 change: 0 additions & 1 deletion allennlp/service/config_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ class App extends React.Component {
setData(fn) {
const {data} = this.state
const newData = markComplete(fn(data))
console.log(newData)
return this.setState({data: newData})
}

Expand Down