{"id":5173,"library":"databricks-feature-store","title":"Databricks Feature Store Client","description":"The `databricks-feature-store` library provides a Python client for interacting with the Databricks Feature Store. It enables data scientists and ML engineers to create, manage, and discover features for machine learning models within the Databricks platform. The current version is 0.17.0. Its release cadence is typically aligned with Databricks Runtime updates, although specific release notes for this client library are often integrated into Databricks documentation.","status":"active","version":"0.17.0","language":"en","source_language":"en","source_url":"https://docs.databricks.com/en/machine-learning/feature-store/index.html","tags":["databricks","feature-store","ml","machine-learning","data-science"],"install":[{"cmd":"pip install databricks-feature-store","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Required for most operations involving DataFrames (e.g., creating feature tables, writing data). Functionality is severely limited without it.","package":"pyspark","optional":true},{"reason":"Often used for converting Spark DataFrames to Pandas DataFrames when fetching features, particularly when interacting with local data.","package":"pandas","optional":true},{"reason":"May be required for authentication and API interaction when running the client outside a Databricks notebook environment or for advanced configuration.","package":"databricks-sdk","optional":true}],"imports":[{"symbol":"FeatureStoreClient","correct":"from databricks.feature_store import FeatureStoreClient"}],"quickstart":{"code":"import os\n# pyspark.sql is often needed for operations using Spark DataFrames\n# from pyspark.sql import SparkSession\nfrom databricks.feature_store import FeatureStoreClient\n\n# NOTE: This client is designed to run primarily within a Databricks Runtime environment.\n# Running it locally typically requires an active Spark session and potentially\n# Databricks SDK configuration for authentication.\n\ntry:\n    # Initialize the FeatureStoreClient.\n    # In a Databricks notebook, this usually works without arguments.\n    # For local testing, it may require a configured Databricks SDK client or environment variables.\n    fs = FeatureStoreClient()\n    print(\"FeatureStoreClient initialized successfully.\")\n    print(\"Full functionality (e.g., creating/reading feature tables) requires a Spark session and Databricks connectivity.\")\n\n    # Example of a minimal operation (will likely fail if not in Databricks Runtime/Spark env)\n    # if os.environ.get(\"DATABRICKS_RUNTIME_VERSION\"):\n    #     # This block would execute if running within Databricks\n    #     print(\"Running within Databricks Runtime. Attempting to list feature tables...\")\n    #     # This requires a SparkSession, usually 'spark' is pre-initialized in DB Runtime\n    #     # try:\n    #     #     # To truly run this, you'd need 'spark' object which comes from pyspark\n    #     #     # If running locally, you'd need to init SparkSession manually.\n    #     #     # E.g., spark = SparkSession.builder.appName(\"local-fs\").getOrCreate()\n    #     #     # print(f\"Number of feature tables: {len(fs.list_tables())}\")\n    #     # except Exception as e:\n    #     #     print(f\"Could not list tables: {e}\")\n    # else:\n    #     print(\"Skipping full Feature Store operations: Not detected in Databricks Runtime.\")\n\nexcept Exception as e:\n    print(f\"Error initializing FeatureStoreClient: {e}\")\n    print(\"Please ensure you are in a Databricks Runtime or have a Spark session and Databricks SDK configured for full functionality.\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Use 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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure 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`.","message":"Most 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the official Databricks documentation for specific API changes when upgrading to new `0.x` client versions. Test code thoroughly after upgrades.","message":"As 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.","severity":"breaking","affected_versions":"0.x.y (all current versions)"},{"fix":"Explicitly install `pyspark` using `pip install pyspark` if you intend to use the client's DataFrame-dependent features outside of a Databricks Runtime environment.","message":"Installing `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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}