---
title: active
description: "SparkSession.active class in PySpark: Returns the active or default SparkSession for the current thread, returned by the builder."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/sparksession/active
---

# active

Returns the active or default `SparkSession` for the current thread, returned by the builder.

## Syntax

```
SparkSession.active()
```

## Returns

`SparkSession`
