bug fixes has function

This commit is contained in:
Steve Nyemba 2023-07-09 17:58:32 -05:00
parent ad84e24533
commit b5794e0a61
1 changed files with 3 additions and 2 deletions

View File

@ -305,7 +305,7 @@ class SQLWriter(SQLRW,Writer):
if 'schema' in _args : if 'schema' in _args :
if type(_args['schema']) == str : if type(_args['schema']) == str :
self.schema = _args['schema'] if 'schema' in _args else self.schema self.schema = _args['schema'] if 'schema' in _args else self.schema
elif type(_args['schema']) == list and not self.has(table): elif type(_args['schema']) == list and not self.has(table=table):
self.make(table=table,schema=_args['schema']) self.make(table=table,schema=_args['schema'])
pass pass
# self.schema = _args['schema'] if 'schema' in _args else self.schema # self.schema = _args['schema'] if 'schema' in _args else self.schema
@ -409,7 +409,8 @@ class BigQuery:
def has(self,**_args): def has(self,**_args):
found = False found = False
try: try:
found = self.meta(**_args) is not None _has = self.meta(**_args)
found = _has is not None and len(_has) > 0
except Exception as e: except Exception as e:
pass pass
return found return found