Commented Old Code
This commit is contained in:
parent
26c9fa6dbd
commit
dee1bf4be0
36
db.py
36
db.py
@ -36,24 +36,24 @@ class db_module():
|
||||
pass
|
||||
|
||||
# This was a old function used prior to the creation of this class. I need to remake it.
|
||||
def get_data_old(self, tableName: str = "", key: str = ""):
|
||||
table = '_channel_commands'
|
||||
table = tableName
|
||||
|
||||
df = pd.read_sql_query('SELECT * FROM ' + table, engine)
|
||||
stmt = "trigger == '" + key + "'"
|
||||
temp = df.query(stmt)
|
||||
result = temp.get("response")
|
||||
|
||||
# print(result)
|
||||
i = len(temp.index.values)
|
||||
|
||||
if i == 1:
|
||||
output = result[temp.index.values[0]]
|
||||
pass
|
||||
else:
|
||||
output = "$$None$$"
|
||||
return output
|
||||
# def get_data_old(self, tableName: str = "", key: str = ""):
|
||||
# table = '_channel_commands'
|
||||
# table = tableName
|
||||
#
|
||||
# df = pd.read_sql_query('SELECT * FROM ' + table, engine)
|
||||
# stmt = "trigger == '" + key + "'"
|
||||
# temp = df.query(stmt)
|
||||
# result = temp.get("response")
|
||||
#
|
||||
# # print(result)
|
||||
# i = len(temp.index.values)
|
||||
#
|
||||
# if i == 1:
|
||||
# output = result[temp.index.values[0]]
|
||||
# pass
|
||||
# else:
|
||||
# output = "$$None$$"
|
||||
# return output
|
||||
|
||||
def get_data(self, tableName: str = "", key: str = ""):
|
||||
pass
|
||||
|
||||
Loading…
Reference in New Issue
Block a user