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

Function doDbChecks

scripts/add_attr_schema.py:42–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 + " (%s, %s, %s)", (item_type, enum_attr_id, enum_value_id))
41
42def doDbChecks():
43 cur = db.cursor()
44 cur.execute("SELECT COUNT(*) FROM ITEM_TYPE")
45 rows = cur.fetchall()
46 if rows[0][0] != 0:
47 print "ITEM_TYPE table was not empty, it had", rows[0][0], 'rows'
48 doExitBecauseDbNotEmpty()
49 cur = db.cursor()
50 cur.execute("SELECT COUNT(*) FROM ITEM_ATTR")
51 rows = cur.fetchall()
52 if rows[0][0] != 0:
53 print "ITEM_ATTR table was not empty, it had", rows[0][0], 'rows'
54 doExitBecauseDbNotEmpty()
55 cur = db.cursor()
56 cur.execute("SELECT COUNT(*) FROM ITEM_ATTR_ENUM")
57 rows = cur.fetchall()
58 if rows[0][0] !=0:
59 print "ITEM_ATTR_ENUM table was not empty, it had", rows[0][0], 'rows'
60 doExitBecauseDbNotEmpty()
61 cur = db.cursor()
62 cur.execute("SELECT COUNT(*) FROM DIMENSION")
63 rows = cur.fetchall()
64 if rows[0][0] !=0:
65 print "DIMENSION table was not empty, it had", rows[0][0], 'rows'
66 doExitBecauseDbNotEmpty()
67
68
69def doExitBecauseDbNotEmpty():

Callers 1

addToDbFunction · 0.70

Calls 2

doExitBecauseDbNotEmptyFunction · 0.70
executeMethod · 0.65

Tested by

no test coverage detected