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

Function clearUp

scripts/add_attr_schema.py:142–158  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

140 return types
141
142def clearUp(db):
143 with db:
144 cur = db.cursor()
145 cur.execute("TRUNCATE TABLE ITEMS")
146 cur.execute("TRUNCATE TABLE DIMENSION")
147 cur.execute("TRUNCATE TABLE ITEM_ATTR_ENUM")
148 cur.execute("TRUNCATE TABLE ITEM_ATTR")
149 cur.execute("TRUNCATE TABLE ITEM_TYPE")
150 cur.execute('truncate table users')
151 cur.execute('truncate table items')
152 cur.execute('truncate table item_map_varchar')
153 cur.execute('truncate table item_map_double')
154 cur.execute('truncate table item_map_datetime')
155 cur.execute('truncate table item_map_int')
156 cur.execute('truncate table item_map_boolean')
157 cur.execute('truncate table item_map_enum')
158 cur.execute('truncate table item_map_text')
159
160parser = argparse.ArgumentParser(description="Adds the data schema defined via a file to the DB. Outputs a file (dimensions.json) which contains shortcuts that can be used to narrow the scope of the recommendation output (see API docs for further information).", prog='add_attr_schema.py')
161parser.add_argument('-db-host', help='database host', required=False, default="localhost")

Callers 1

add_attr_schema.pyFile · 0.70

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected