コード例 #1
0
 def get_response(cls, cursor: pyodbc.Cursor) -> AdapterResponse:
     rows = cursor.rowcount
     message = 'OK' if rows == -1 else str(rows)
     return AdapterResponse(
         _message=message,
         rows_affected=rows
     )
コード例 #2
0
 def get_response(cls, cursor) -> AdapterResponse:
     """
     new to support dbt 0.19: this method replaces get_response
     """
     message = 'OK'
     rows = cursor.rowcount
     return AdapterResponse(_message=message, rows_affected=rows)
コード例 #3
0
    def get_response(cls, cursor) -> AdapterResponse:
        code = "Unknown cursor state/status"

        return AdapterResponse(
            _message="{} {}".format(code, cursor.rowcount),
            rows_affected=cursor.rowcount,
            code=code
        )
コード例 #4
0
    def get_response(cls, cursor) -> AdapterResponse:
        if cursor.state == AthenaQueryExecution.STATE_SUCCEEDED:
            code = "OK"
        else:
            code = "ERROR"

        return AdapterResponse(_message="{} {}".format(code, cursor.rowcount),
                               rows_affected=cursor.rowcount,
                               code=code)
コード例 #5
0
ファイル: providers.py プロジェクト: chrisp-data/all_data
 def store_raw_result(self,
                      name: str,
                      message=Optional[str],
                      code=Optional[str],
                      rows_affected=Optional[str],
                      agate_table: Optional[agate.Table] = None) -> str:
     response = AdapterResponse(_message=message,
                                code=code,
                                rows_affected=rows_affected)
     return self.store_result(name, response, agate_table)
コード例 #6
0
 def get_response(
         cls,
         cursor: MySQLdb.cursors.Cursor) -> Union[AdapterResponse, str]:
     code = "Unknown cursor state/status"
     rows = cursor.rowcount
     return AdapterResponse(
         code=code,
         _message=f"{rows} rows affected",
         rows_affected=rows,
     )
コード例 #7
0
    def get_response(cls, cursor) -> AdapterResponse:
        code = "SUCCESS"
        num_rows = 0

        if cursor is not None and cursor.rowcount is not None:
            num_rows = cursor.rowcount

        # There's no real way to get the status from the mysql-connector-python driver.
        # So just return the default value.
        return AdapterResponse(_message="{} {}".format(code, num_rows),
                               rows_affected=num_rows,
                               code=code)
コード例 #8
0
 def get_response(cls, cursor) -> AdapterResponse:
     message = str(cursor.statusmessage)
     rows = cursor.rowcount
     status_message_parts = message.split() if message is not None else []
     status_messsage_strings = [
         part
         for part in status_message_parts
         if not part.isdigit()
     ]
     code = ' '.join(status_messsage_strings)
     return AdapterResponse(
         _message=message,
         code=code,
         rows_affected=rows
     )
コード例 #9
0
 def get_response(cls, cursor) -> AdapterResponse:
     #message = str(cursor.statusmessage)
     message = 'OK'
     rows = cursor.rowcount
     #status_message_parts = message.split() if message is not None else []
     #status_messsage_strings = [
     #    part
     #    for part in status_message_parts
     #    if not part.isdigit()
     #]
     #code = ' '.join(status_messsage_strings)
     return AdapterResponse(
         _message=message,
         #code=code,
         rows_affected=rows)
コード例 #10
0
    def get_response(cls, cursor) -> AdapterResponse:

        message = 'OK'
        rows = cursor.rowcount

        return AdapterResponse(_message=message, rows_affected=rows)
コード例 #11
0
 def get_response(cls, cursor) -> AdapterResponse:
     # https://github.com/dbt-labs/dbt-spark/issues/142
     message = 'OK'
     return AdapterResponse(_message=message)
コード例 #12
0
ファイル: connections.py プロジェクト: rsella/oracle4dbt
 def get_response(cls, cursor: Any) -> Union[AdapterResponse, str]:
     return AdapterResponse(_message='OK', code=cursor.statement, rows_affected=cursor.rowcount)