snowflake.snowpark.functions.current_transaction¶
- snowflake.snowpark.functions.current_transaction() Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.39.1/src/snowflake/snowpark/_functions/scalar_functions.py#L120-L130)¶
Returns the current transaction ID for the session, or NULL if no transaction is active.
Example
>>> # Return result is tied to session, so we only test if the result exists >>> result = session.create_dataframe([1]).select(current_transaction()).collect() >>> assert result[0]['CURRENT_TRANSACTION()'] is None or isinstance(result[0]['CURRENT_TRANSACTION()'], str)