class_docstr: A connection to Snowpark using snowflake.snowpark.session.Session. Initialize using
  ``st.connection("<name>", type="snowpark")``.
  
  In addition to providing access to the Snowpark Session, SnowparkConnection supports
  direct SQL querying using ``query("...")`` and thread safe access using
  ``with conn.safe_session():``. See methods below for more information.
  SnowparkConnections should always be created using ``st.connection()``, **not**
  initialized directly.
  
  .. note::
      We don't expect this iteration of SnowparkConnection to be able to scale
      well in apps with many concurrent users due to the lock contention that will occur
      over the single underlying Session object under high load.
class_docstr_tok: ["A","connection","to","Snowpark","using","snowflake.snowpark.session.Session",".","Initialize","using","``","st.connection","(","``","<","name",">","''",",","type=","''","snowpark","''",")","``",".","In","addition","to","providing","access","to","the","Snowpark","Session",",","SnowparkConnection","supports","direct","SQL","querying","using","``","query","(","``","...","''",")","``","and","thread","safe","access","using","``","with","conn.safe_session","(",")",":","``",".","See","methods","below","for","more","information",".","SnowparkConnections","should","always","be","created","using","``","st.connection","(",")","``",",","*","*","not","*","*","initialized","directly",".","..","note",":",":","We","do","n't","expect","this","iteration","of","SnowparkConnection","to","be","able","to","scale","well","in","apps","with","many","concurrent","users","due","to","the","lock","contention","that","will","occur","over","the","single","underlying","Session","object","under","high","load","."]
docstr: Access the underlying Snowpark session.
  
  .. note::
      Snowpark sessions are **not** thread safe. Users of this method are
      responsible for ensuring that access to the session returned by this method is
      done in a thread-safe manner. For most users, we recommend using the thread-safe
      safe_session() method and a ``with`` block.
  
  Information on how to use Snowpark sessions can be found in the `Snowpark documentation
  <https://docs.snowflake.com/en/developer-guide/snowpark/python/working-with-dataframes>`_.
  
  Example
  -------
  >>> import streamlit as st
  >>>
  >>> session = st.connection("snowpark").session
  >>> df = session.table("mytable").limit(10).to_pandas()
  >>> st.dataframe(df)
docstr_tok: ["Access","the","underlying","Snowpark","session",".","..","note",":",":","Snowpark","sessions","are","*","*","not","*","*","thread","safe",".","Users","of","this","method","are","responsible","for","ensuring","that","access","to","the","session","returned","by","this","method","is","done","in","a","thread-safe","manner",".","For","most","users",",","we","recommend","using","the","thread-safe","safe_session","(",")","method","and","a","``","with","``","block",".","Information","on","how","to","use","Snowpark","sessions","can","be","found","in","the","`","Snowpark","documentation","<","https",":","\/\/docs.snowflake.com\/en\/developer-guide\/snowpark\/python\/working-with-dataframes",">","`","_",".","Example","--","--","--","-",">",">",">","import","streamlit","as","st",">",">",">",">",">",">","session","=","st.connection","(","``","snowpark","''",")",".session",">",">",">","df","=","session.table","(","``","mytable","''",")",".limit","(","10",")",".to_pandas","(",")",">",">",">","st.dataframe","(","df",")"]
code: def session(self) -> "Session":
      """Access the underlying Snowpark session.
  
      .. note::
          Snowpark sessions are **not** thread safe. Users of this method are
          responsible for ensuring that access to the session returned by this method is
          done in a thread-safe manner. For most users, we recommend using the thread-safe
          safe_session() method and a ``with`` block.
  
      Information on how to use Snowpark sessions can be found in the `Snowpark documentation
      <https://docs.snowflake.com/en/developer-guide/snowpark/python/working-with-dataframes>`_.
  
      Example
      -------
      >>> import streamlit as st
      >>>
      >>> session = st.connection("snowpark").session
      >>> df = session.table("mytable").limit(10).to_pandas()
      >>> st.dataframe(df)
      """
      return self._instance
  
file_path: streamlit/lib/streamlit/connections/snowpark_connection.py
imports: import threading
  from collections import ChainMap
  from contextlib import contextmanager
  from datetime import timedelta
  from typing import TYPE_CHECKING, Iterator, Optional, Union, cast
  import pandas
  from streamlit.connections import BaseConnection
  from streamlit.connections.util import SNOWSQL_CONNECTION_FILE, load_from_snowsql_config_file, running_in_sis
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.caching import cache_data
label_desc: Use image node_id 4 for calling the SnowparkConnection obj's underlying member method code with example usage: obj.session() and returns: self