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

Function doDbChecks

python/seldon/shell/attr_schema_utils.py:51–75  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

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

Callers 1

addToDbFunction · 0.70

Calls 2

doExitBecauseDbNotEmptyFunction · 0.70
executeMethod · 0.65

Tested by

no test coverage detected