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

Class SchemaEntityCopy

language/xsp/data_preprocessing/sql_utils.py:82–102  ·  view source on GitHub ↗

A copy action from the schema.

Source from the content-addressed store, hash-verified

80
81
82class SchemaEntityCopy(object):
83 """A copy action from the schema."""
84
85 def __init__(self, copied_table=None, copied_column=None):
86 self.copied_table = copied_table
87 self.copied_column = copied_column
88
89 def to_json(self):
90 if self.copied_table:
91 return {'copied_table': self.copied_table.to_json()}
92 if self.copied_column:
93 return {'copied_column': self.copied_column.to_json()}
94
95 def from_json(self, dictionary):
96 if 'copied_table' in dictionary:
97 self.copied_table = DatabaseTable().from_json(dictionary['copied_table'])
98 return self
99
100 if 'copied_column' in dictionary:
101 self.copied_column = TableColumn().from_json(dictionary['copied_column'])
102 return self
103
104
105class SQLAction(object):

Callers 6

_resolve_referenceFunction · 0.90
_find_directionFunction · 0.90
_parse_identifierFunction · 0.90
_add_table_copyFunction · 0.90
_add_column_copyFunction · 0.90
from_jsonMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…