Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-584369 get_results_from_sfqid missing errno #1156

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne



- v2.7.9()
sfc-gh-mkeller marked this conversation as resolved.
Show resolved Hide resolved

- Fixed a bug where errors raised during get_results_from_sfqid() were missing errno


- v2.7.8(May 28,2022)

- Updated PyPi documentation link to python specific main page
- Updated PyPi documentation link to python specific main page
- Fixed an error message that appears when pandas optional dependency group is required but is not installed
- Implemented the DB API 2 callproc() method
- Fixed a bug where decryption took place before decompression when downloading files from stages
- Fixed a bug where s3 accelerate configuration was handled incorrectly
- Fixed a bug where s3 accelerate configuration was handled incorrectly
- Extra named arguments given executemany() are now forwarded to execute()
- Automatically sets the application name to streamlit when streamlit is imported and application name was not explicitly set
- Bumped pyopenssl dependency version to >=16.2.0,<23.0.0
Expand Down
4 changes: 1 addition & 3 deletions src/snowflake/connector/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,7 @@ def get_query_status_throw_if_error(self, sf_qid: str) -> QueryStatus:
message = status_resp.get("message")
if message is None:
message = ""
code = status_resp.get("code")
if code is None:
code = -1
code = queries[0].get("errorCode", -1)
sql_state = None
if "data" in status_resp:
message += (
Expand Down
11 changes: 8 additions & 3 deletions test/integ/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ def test_async_error(conn_cnx):
"""
with conn_cnx() as con:
with con.cursor() as cur:
cur.execute_async("select * from nonexistentTable")
sql = "select * from nonexistentTable"
cur.execute_async(sql)
q_id = cur.sfqid
with pytest.raises(ProgrammingError) as sync_error:
cur.execute(sql)
while con.is_still_running(con.get_query_status(q_id)):
time.sleep(1)
status = con.get_query_status(q_id)
assert status == QueryStatus.FAILED_WITH_ERROR
assert con.is_an_error(status)
with pytest.raises(ProgrammingError):
with pytest.raises(ProgrammingError) as e1:
con.get_query_status_throw_if_error(q_id)
with pytest.raises(ProgrammingError):
assert sync_error.value.errno != -1
with pytest.raises(ProgrammingError) as e2:
cur.get_results_from_sfqid(q_id)
assert e1.value.errno == e2.value.errno == sync_error.value.errno


def test_mix_sync_async(conn_cnx):
Expand Down