Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_status(cls, cursor):
"""Get the status of the cursor.
:param cursor: A database handle to get status from
:return: The current status
:rtype: str
"""
raise dbt.exceptions.NotImplementedException(
'`get_status` is not implemented for this adapter!'
)
def cancel(self, connection):
"""Cancel the given connection.
:param Connection connection: The connection to cancel.
"""
raise dbt.exceptions.NotImplementedException(
'`cancel` is not implemented for this adapter!'
)
def list_schemas(self, database: str) -> List[str]:
"""Get a list of existing schemas in database"""
raise dbt.exceptions.NotImplementedException(
'`list_schemas` is not implemented for this adapter!'
)
def list_relations_without_caching(
self, information_schema: BaseRelation, schema: str
) -> List[BaseRelation]:
"""List relations in the given schema, bypassing the cache.
This is used as the underlying behavior to fill the cache.
:param Relation information_schema: The information schema to list
relations from.
:param str schema: The name of the schema to list relations from.
:return: The relations in schema
:rtype: List[self.Relation]
"""
raise dbt.exceptions.NotImplementedException(
'`list_relations_without_caching` is not implemented for this '
'adapter!'
def after_execute(self, result):
raise NotImplementedException()
def convert_datetime_type(
cls, agate_table: agate.Table, col_idx: int
) -> str:
"""Return the type in the database that best maps to the agate.DateTime
type for the given agate table and column index.
:param agate_table: The table
:param col_idx: The index into the agate table for the column.
:return: The name of the type in the database
"""
raise NotImplementedException(
'`convert_datetime_type` is not implemented for this adapter!')
def rename_relation(self, from_relation, to_relation, model_name=None):
raise dbt.exceptions.NotImplementedException(
'`rename_relation` is not implemented for this adapter!')
def track_run(task):
dbt.tracking.track_invocation_start(config=task.config, args=task.args)
try:
yield
dbt.tracking.track_invocation_end(
config=task.config, args=task.args, result_type="ok"
)
except (dbt.exceptions.NotImplementedException,
dbt.exceptions.FailedToConnectException) as e:
logger.error('ERROR: {}'.format(e))
dbt.tracking.track_invocation_end(
config=task.config, args=task.args, result_type="error"
)
except Exception:
dbt.tracking.track_invocation_end(
config=task.config, args=task.args, result_type="error"
)
raise
finally:
dbt.tracking.flush()
def execute(self, sql, name=None, auto_begin=False, fetch=False):
"""Execute the given SQL.
:param str sql: The sql to execute.
:param Optional[str] name: The name to use for the connection.
:param bool auto_begin: If set, and dbt is not currently inside a
transaction, automatically begin one.
:param bool fetch: If set, fetch results.
:return: A tuple of the status and the results (empty if fetch=False).
:rtype: Tuple[str, agate.Table]
"""
raise dbt.exceptions.NotImplementedException(
'`execute` is not implemented for this adapter!'
)
def build_query(self):
raise dbt.exceptions.NotImplementedException('Not Implemented')