Major update to readRow which now extracts necessary row items into runtime for filtering. Debugging prints suppressed
This commit is contained in:
+21
-13
@@ -110,7 +110,7 @@ def readRow(action, resolved, outputs):
|
||||
columnattr = ""
|
||||
columnattr = key + " " + value
|
||||
|
||||
print(columnattr)
|
||||
#print(columnattr)
|
||||
column_creation.append(columnattr)
|
||||
|
||||
rowsearchvalue = action.readrow["rowsearchvalue"]
|
||||
@@ -125,6 +125,10 @@ def readRow(action, resolved, outputs):
|
||||
|
||||
values.append(value)
|
||||
|
||||
exports = action.readrow["export"]
|
||||
for column_index, output_name in exports.items():
|
||||
outputs.pop(output_name, None)
|
||||
|
||||
database = sqlite3.connect("savedata/rmmanager.db")
|
||||
|
||||
columnitems = ", ".join(column_creation)
|
||||
@@ -142,21 +146,25 @@ def readRow(action, resolved, outputs):
|
||||
""",
|
||||
(value,)
|
||||
)
|
||||
print("DEBUG RESOLVED TARGET ITEM")
|
||||
print(value)
|
||||
#print("DEBUG READROW TARGET ITEM")
|
||||
#print(value)
|
||||
|
||||
result = cursor.fetchone()
|
||||
print(result)
|
||||
|
||||
## extension for matching by unique item vs column find
|
||||
if result is not None:
|
||||
for column_index, output_name in exports.items():
|
||||
dbtarget = result[column_index]
|
||||
outputs[output_name] = dbtarget# result[column_index]
|
||||
#print("DEBUGGING DATABASE LINE EXTRACTION IN READROW")
|
||||
#print(outputs[output_name])
|
||||
#print(dbtarget)
|
||||
|
||||
try:
|
||||
target = result[action.readrow["columnnumber"]]
|
||||
except TypeError:
|
||||
target = None
|
||||
print("Message ID not found in database")
|
||||
return resolved, outputs
|
||||
else:
|
||||
print(f"Search target {value} not found in database table {table}")
|
||||
return resolved, outputs
|
||||
|
||||
outputs["databasetarget"] = target
|
||||
|
||||
print("READROW TEST")
|
||||
print(target)
|
||||
#print("READROW SEARCH RESULT")
|
||||
#print(target)
|
||||
return resolved, outputs
|
||||
Reference in New Issue
Block a user