Registry /
data / databricks-feature-store
Install & Compatibility
Where this runs
tested against v0.17.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 329.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 22.9s · import 0.000s · 322MB
319MB installed
● package 319MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FeatureStoreClient
✓ from databricks.feature_store import FeatureStoreClient
Initializes the Databricks Feature Store Client. This library is primarily intended for use within a Databricks Runtime environment. While the client can be initialized locally, most operations (like creating or reading feature tables) require an active Spark session and proper connectivity to a Databricks workspace. The `pyspark` dependency is crucial for operations involving Spark DataFrames. The example demonstrates basic client initialization and highlights environmental dependencies.
import os
# pyspark.sql is often needed for operations using Spark DataFrames
# from pyspark.sql import SparkSession
from databricks.feature_store import FeatureStoreClient
# NOTE: This client is designed to run primarily within a Databricks Runtime environment.
# Running it locally typically requires an active Spark session and potentially
# Databricks SDK configuration for authentication.
try:
# Initialize the FeatureStoreClient.
# In a Databricks notebook, this usually works without arguments.
# For local testing, it may require a configured Databricks SDK client or environment variables.
fs = FeatureStoreClient()
print("FeatureStoreClient initialized successfully.")
print("Full functionality (e.g., creating/reading feature tables) requires a Spark session and Databricks connectivity.")
# Example of a minimal operation (will likely fail if not in Databricks Runtime/Spark env)
# if os.environ.get("DATABRICKS_RUNTIME_VERSION"):
# # This block would execute if running within Databricks
# print("Running within Databricks Runtime. Attempting to list feature tables...")
# # This requires a SparkSession, usually 'spark' is pre-initialized in DB Runtime
# # try:
# # # To truly run this, you'd need 'spark' object which comes from pyspark
# # # If running locally, you'd need to init SparkSession manually.
# # # E.g., spark = SparkSession.builder.appName("local-fs").getOrCreate()
# # # print(f"Number of feature tables: {len(fs.list_tables())}")
# # except Exception as e:
# # print(f"Could not list tables: {e}")
# else:
# print("Skipping full Feature Store operations: Not detected in Databricks Runtime.")
except Exception as e:
print(f"Error initializing FeatureStoreClient: {e}")
print("Please ensure you are in a Databricks Runtime or have a Spark session and Databricks SDK configured for full functionality.")
Debug
Known issues
gotchaThe `databricks-feature-store` client is designed to operate primarily within a Databricks Runtime for Machine Learning environment. Full functionality (e.g., creating, reading, writing feature tables) is dependent on an active Spark session managed by Databricks.fixUse the client within a Databricks notebook or job. For local development, ensure `pyspark` is installed and a Spark session is explicitly configured, potentially using the `databricks-sdk` for authentication and connectivity to a Databricks workspace.
affects: All versions
gotchaMost core operations of the Feature Store client that interact with data (e.g., `create_feature_table`, `write_table`, `read_table`) require an active Apache Spark session (e.g., `spark` variable available). Without it, these methods will raise errors.fixEnsure your environment has a configured Spark session. In Databricks Runtime, this is typically available as the `spark` global variable. For local development, you need to manually initialize a `SparkSession`.
affects: All versions
breakingAs a `0.x.y` version library, the API is subject to change in minor releases. Breaking changes might occur without a major version increment, requiring updates to existing code.fixRefer to the official Databricks documentation for specific API changes when upgrading to new `0.x` client versions. Test code thoroughly after upgrades.
affects: 0.x.y (all current versions)
gotchaInstalling `databricks-feature-store` locally does not automatically install `pyspark`. Attempts to use DataFrame-related functionalities will result in `ModuleNotFoundError` or similar errors if `pyspark` is not separately installed.fixExplicitly install `pyspark` using `pip install pyspark` if you intend to use the client's DataFrame-dependent features outside of a Databricks Runtime environment.
affects: All versions
Upgrade
Version history
0.17.0latest on PyPI · released Jan 9, 2024
Audit
Dependencies
pysparkoptionalRequired for most operations involving DataFrames (e.g., creating feature tables, writing data). Functionality is severely limited without it.
pandasoptionalOften used for converting Spark DataFrames to Pandas DataFrames when fetching features, particularly when interacting with local data.
databricks-sdkoptionalMay be required for authentication and API interaction when running the client outside a Databricks notebook environment or for advanced configuration.