MCPcopy Create free account
hub / github.com/google-research/language / _parse_operation

Function _parse_operation

language/xsp/data_preprocessing/sql_parsing.py:568–585  ·  view source on GitHub ↗

Parse the part relative to an Operation in the SQL query.

(sql, example, anonymize_values)

Source from the content-addressed store, hash-verified

566
567
568def _parse_operation(sql, example, anonymize_values):
569 """Parse the part relative to an Operation in the SQL query."""
570 successful_copy = True
571 for item in sql:
572 if item.ttype == sqlparse.tokens.Text.Whitespace:
573 continue
574 if _is_identifier(item):
575 successful_copy = _parse_identifier(item, example,
576 anonymize_values) and successful_copy
577 continue
578 if _is_operator(item):
579 _add_simple_step(item, example)
580 continue
581
582 _debug_sql_item(item)
583 raise ParseError('Incomplete _parse_operation')
584
585 return successful_copy
586
587
588def _parse_identifier_list(sql, example, anonymize_values):

Callers 3

_parse_identifier_listFunction · 0.85
_parse_comparisonFunction · 0.85
populate_sqlFunction · 0.85

Calls 6

_is_identifierFunction · 0.85
_parse_identifierFunction · 0.85
_is_operatorFunction · 0.85
_add_simple_stepFunction · 0.85
_debug_sql_itemFunction · 0.85
ParseErrorClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…