PyHive icon indicating copy to clipboard operation
PyHive copied to clipboard

can not raise NoSuchTableError for has_table method

Open hkklearn opened this issue 6 years ago • 3 comments

     regex = r"Table\ \'.*{}\'\ does\ not\ exist".format(re.escape(table_name))
            
     if msg and re.search(regex, msg):
            raise exc.NoSuchTableError(table_name)
        else:
            raise

with presto and Oracle, Oracle has table name with upper case, but table name in error message which return from presto is with lower case, so re.search method will return None, then has_table method will exit with uncaught exception.

maybe we should use re.IGNORECASE in re.search method

hkklearn avatar Oct 14 '19 07:10 hkklearn