Finds a column annotation in a given direction.
(reverse)
| 297 | return |
| 298 | |
| 299 | def _find_direction(reverse): |
| 300 | """Finds a column annotation in a given direction.""" |
| 301 | table_entities = _find_from_table(item, example, reverse=reverse) |
| 302 | |
| 303 | if not table_entities: |
| 304 | return False |
| 305 | |
| 306 | for table_entity in table_entities: |
| 307 | entity = _find_column_entities(item.value, example, table_entity) |
| 308 | |
| 309 | if entity: |
| 310 | example.gold_sql_query.actions.append( |
| 311 | SQLAction(entity_copy=SchemaEntityCopy(copied_column=entity))) |
| 312 | return True |
| 313 | |
| 314 | raise ParseError('Unable to find annotation of table ' + str(item)) |
| 315 | |
| 316 | if (prev_symbol in ('where', 'by') or _is_where(parent) or |
| 317 | _is_where(parent.parent)): |
no test coverage detected
searching dependent graphs…