Skip to content

Commit

Permalink
fix dbt can't detect error when submit a set of query in one execute
Browse files Browse the repository at this point in the history
call
  • Loading branch information
viplazylmht committed Aug 11, 2022
1 parent 255e1ac commit f4f215c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions dbt/adapters/vertica/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,18 @@ def open(cls, connection):

@classmethod
def get_response(cls, cursor):
code = cursor.description
rows = cursor.rowcount

rows_affected = cursor.fetchone()[0]
while cursor.nextset():
rows_affected = cursor.fetchone()[0]

code = "DONE"
message = cursor._message
arraysize = cursor.arraysize
operation = cursor.operation

return AdapterResponse(
_message="Code: {}, Rows: {}, Array Size: {}".format(str(code), rows, arraysize),
rows_affected=rows,
_message="Code: {}, Rows Affected: {}".format(str(code), rows_affected),
rows_affected=rows_affected,
code=str(code)
)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pathlib

package_name = "dbt-vertica"
package_version = "1.0.3.1-rc3"
package_version = "1.0.3.1-rc4"
description = """The vertica adapter plugin for dbt (data build tool)"""

HERE = pathlib.Path(__file__).parent
Expand Down

0 comments on commit f4f215c

Please sign in to comment.