Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_session_logon_failure(self):
sessionid = 'ILoveDancingOnTables'
with pytest.raises(Error):
connect(sessionid=sessionid, host='localhost', protocol='binary')
pymapd.fetchone() to iterate through all
of the results.
total_time(float): Time (in ms) from adding all above times.
False(bool): The query failed. Exception should be logged.
"""
start_time = timeit.default_timer()
try:
# Run the query
query_result = kwargs["con"].execute(kwargs["query_mapdql"])
logging.debug(
"Completed iteration "
+ str(kwargs["iteration"])
+ " of query "
+ kwargs["query_name"]
)
except (pymapd.exceptions.ProgrammingError, pymapd.exceptions.Error):
logging.exception(
"Error running query "
+ kwargs["query_name"]
+ " during iteration "
+ str(kwargs["iteration"])
)
return False
# Calculate times
query_elapsed_time = (timeit.default_timer() - start_time) * 1000
execution_time = query_result._result.execution_time_ms
connect_time = round((query_elapsed_time - execution_time), 1)
# Iterate through each result from the query
logging.debug(
"Counting results from query"
+ kwargs["query_name"]
from omnisci.mapd.ttypes import TMapDException
class Warning(Exception):
"""Emitted for important warnings, e.g. data truncatiions"""
class Error(Exception):
"""Base class for all pymapd errors."""
class InterfaceError(Error):
"""Raised whenever you use pymapd interface incorrectly."""
class DatabaseError(Error):
"""Raised when the database encounters an error."""
class DataError(DatabaseError):
"""Raised for data processing errors like division by zero, etc."""
class OperationalError(DatabaseError):
"""Raised for non-programmer related database errors, e.g.
an unexpected disconnect.
"""
class IntegrityError(DatabaseError):
"""Raised when the relational integrity of the database is affected."""
Includes some helper methods for translating thrift
exceptions to the ones defined here.
"""
from omnisci.mapd.ttypes import TMapDException
class Warning(Exception):
"""Emitted for important warnings, e.g. data truncatiions"""
class Error(Exception):
"""Base class for all pymapd errors."""
class InterfaceError(Error):
"""Raised whenever you use pymapd interface incorrectly."""
class DatabaseError(Error):
"""Raised when the database encounters an error."""
class DataError(DatabaseError):
"""Raised for data processing errors like division by zero, etc."""
class OperationalError(DatabaseError):
"""Raised for non-programmer related database errors, e.g.
an unexpected disconnect.
"""