MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / create_schema

Function create_schema

python/seldon/cli/attr_schema_utils.py:172–195  ·  view source on GitHub ↗
(client_name, dbSettings, scheme_file_path, clean=False)

Source from the content-addressed store, hash-verified

170 cur.execute('truncate table item_map_text')
171
172def create_schema(client_name, dbSettings, scheme_file_path, clean=False):
173
174 if clean != True:
175 json_data=open(scheme_file_path)
176 data = json.load(json_data)
177 if 'types' not in data:
178 print "couldn't find types object in json"
179 return
180 else:
181 types = readTypes(data['types'])
182
183 db = MySQLdb.connect(user=dbSettings["user"],db=client_name,passwd=dbSettings["password"], host=dbSettings["host"])
184 if clean == True:
185 clearUp(db)
186 print "Finished cleaning attributes successfully"
187 else:
188 addToDb(db, types)
189 #f = open('dimensions.json','w')
190 #outputDimensionsToFile(f,db)
191 outputDimensions(db)
192
193 print 'Finished applying attributes successfully'
194
195 json_data.close()
196
197def show_dimensions(client_name, dbSettings):
198 db = MySQLdb.connect(user=dbSettings["user"],db=client_name,passwd=dbSettings["password"], host=dbSettings["host"])

Callers

nothing calls this directly

Calls 6

outputDimensionsFunction · 0.85
readTypesFunction · 0.70
clearUpFunction · 0.70
addToDbFunction · 0.70
loadMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected