Clean up and I think I fixed a weird bug with Pydantic models and the list object type. It seems to try for a dict conversion first if Union[dict,list] is used.

This commit is contained in:
Scott Idem
2021-06-29 18:12:52 -04:00
parent 2d988fc405
commit 830b9ee608
6 changed files with 70 additions and 25 deletions

View File

@@ -288,16 +288,17 @@ def sql_insert_or_update(
# The catch all SQL SELECT function - STI 2021-02-17
# This one does it all for SQL SELECT queries
def sql_select(
table_name:str|None=None,
record_id:int|None=None,
record_id_random:str|None=None,
field_name:str|None=None,
field_value=None,
sql:str|None=None,
data:dict|None=None,
rm_id_random:bool=False,
as_dict:bool|None=True,
as_list:bool|None=False
table_name: str|None = None,
record_id: int|None = None,
record_id_random: str|None = None,
field_name: str|None = None,
field_value = None,
sql: str|None = None,
data: dict|None = None,
rm_id_random: bool = False,
as_dict: bool|None = True,
as_list: bool|None = False,
max_count: int = 100000
):
#log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())