Add checks for more types of empty strings.
@@ -117,13 +117,14 @@ class CGPM_Metamodel(IBayesDBMetamodel):
SELECT colno, name, stattype FROM bayesdb_variable
WHERE population_id = ? AND 0 <= colno
''', (population_id,))
+ unbalanced_quotes = ['\'"', '"\'']
for colno, name, stattype in vars_cursor:
if _is_categorical(stattype):
qn = sqlite3_quote_name(name)
cursor = bdb.sql_execute('''
SELECT DISTINCT %s FROM %s WHERE %s IS NOT NULL AND %s NOT
- IN ('', "''")
- ''' % (qn, qt, qn, qn))
+ IN ('', "''", '""', ?, ?)
+ ''' % (qn, qt, qn, qn), unbalanced_quotes)
for code, (value,) in enumerate(cursor):
bdb.sql_execute('''
INSERT INTO bayesdb_cgpm_category
