Skip to content

Commit 79a106b

Browse files
sfc-gh-mkellersfc-gh-abhatnagar
authored andcommitted
SNOW-171018 Add pandas result scan automated test
1 parent 54a3004 commit 79a106b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def _post_request(self, url, headers, body, token=None,
529529

530530
def fetch(self, method, full_url, headers, data=None, timeout=None,
531531
**kwargs):
532-
"""Carry ouyt API request with session management."""
532+
"""Carry out API request with session management."""
533533

534534
class RetryCtx(object):
535535
def __init__(self, timeout, _include_retry_params=False):

test/pandas/test_arrow_pandas.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,3 +660,17 @@ def finish(conn_cnx, table):
660660
with conn_cnx() as json_cnx:
661661
cursor_json = json_cnx.cursor()
662662
cursor_json.execute("drop table if exists {};".format(table))
663+
664+
665+
@pytest.mark.skipif(
666+
not installed_pandas or no_arrow_iterator_ext,
667+
reason="arrow_iterator extension is not built, or pandas is missing.")
668+
def test_arrow_fetch_result_scan(conn_cnx):
669+
with conn_cnx() as cnx:
670+
cur = cnx.cursor()
671+
cur.execute("alter session set query_result_format='ARROW_FORCE'")
672+
cur.execute("alter session set python_connector_query_result_format='ARROW_FORCE'")
673+
res = cur.execute("select 1, 2, 3").fetch_pandas_all()
674+
assert tuple(res) == ('1', '2', '3')
675+
result_scan_res = cur.execute("select * from table(result_scan('{}'));".format(cur.sfqid)).fetch_pandas_all()
676+
assert tuple(result_scan_res) == ('1', '2', '3')

0 commit comments

Comments
 (0)