Louis_Frolio
Databricks Employee
Databricks Employee
The error you're encountering, TypeError: 'NoneType' object cannot be interpreted as an integer, arises because the workspace_id is not properly set when running the FeatureEngineeringClient in a local notebook using Visual Studio Code. This issue likely stems from the absence of a correctly initialized workspace context required by the Databricks Feature Engineering Client.
Here's how you can address this issue:
  1. Set the Workspace ID Manually:
    • The FeatureEngineeringClient expects the workspace_id to be set. If the automatic fetch fails in the local environment, you can assign it manually. To do so, retrieve your workspace ID (available in your Databricks workspace URL, e.g., https://<workspace-id>.cloud.databricks.com) and set it using code like this:
      from databricks.feature_engineering import FeatureEngineeringClient
    
      client = FeatureEngineeringClient()
      workspace_id = "<your_workspace_id>"  # Replace with your actual workspace ID
      client._catalog_client._local_workspace_id = workspace_id
      client._catalog_client._feature_store_workspace_id = workspace_id
      
    This method has been used successfully by others encountering similar issues.
  2. Ensure Proper Environment Configuration:
    • Verify that the required environment variables or Spark configurations are set up properly. Common variables to check in your local setup include:
      • WORKSPACE_ID
      • _DATABRICKS_WORKSPACE_HOST
      • _DATABRICKS_WORKSPACE_ID
    In some cases, however, even setting these variables might not resolve the issue, as observed in similar scenarios.
  3. Check Databricks Connect Integration:
    • If you are using the Databricks extension for Visual Studio Code, ensure that Databricks Connect is configured properly. This includes installing the necessary dependencies and configuring access credentials. Refer to the Databricks Connect documentation for detailed steps.

View solution in original post