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

Function doDbChecks

python/seldon/cli/attr_schema_utils.py:44–68  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

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

Callers 1

addToDbFunction · 0.70

Calls 2

doExitBecauseDbNotEmptyFunction · 0.70
executeMethod · 0.65

Tested by

no test coverage detected