Converts from a JSON representation to a SQL action.
(self, dictionary)
| 123 | return {'utterance_copy': self.utterance_copy.to_json()} |
| 124 | |
| 125 | def from_json(self, dictionary): |
| 126 | """Converts from a JSON representation to a SQL action.""" |
| 127 | # Should only have one key -- any of the above keys. |
| 128 | assert len(dictionary) == 1 |
| 129 | if 'symbol' in dictionary: |
| 130 | self.symbol = dictionary['symbol'] |
| 131 | return self |
| 132 | |
| 133 | if 'entity_copy' in dictionary: |
| 134 | self.entity_copy = SchemaEntityCopy().from_json(dictionary['entity_copy']) |
| 135 | return self |
| 136 | |
| 137 | if 'utterance_copy' in dictionary: |
| 138 | self.utterance_copy = Wordpiece().from_json(dictionary['utterance_copy']) |
| 139 | return self |
| 140 | |
| 141 | |
| 142 | class SQLQuery(object): |
nothing calls this directly
no test coverage detected