Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-evandenberg committed Sep 16, 2024
1 parent 18f73f0 commit 37b778d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3466,11 +3466,14 @@ def query_history(self, include_describe: bool = False) -> QueryHistory:
Args:
include_describe: Include query notifications for describe queries
>>> with session.query_history() as query_history:
>>> with session.query_history(True) as query_history:
... df = session.create_dataframe([[1, 2], [3, 4]], schema=["a", "b"])
... df = df.filter(df.a == 1)
... res = df.collect()
>>> assert len(query_history.queries) == 1
>>> assert len(query_history.queries) == 2
>>> assert query_history.queries[0].is_describe
>>> assert query_history.queries[1].is_describe
>>> assert not query_history.queries[2].is_describe
"""
query_listener = QueryHistory(self, include_describe)
self._conn.add_query_listener(query_listener)
Expand Down

0 comments on commit 37b778d

Please sign in to comment.