snowflake.snowpark.functions.current_transaction

snowflake.snowpark.functions.current_transaction() Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.43.0/src/snowflake/snowpark/_functions/scalar_functions.py#L121-L131)

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)
Copy
语言: 中文