databricks-demos / dbdemos

Demos to implement your Databricks Lakehouse
Other
255 stars 80 forks source link

catalog is not defined for demo "llm-rag-chatbot" #106

Open liangz1 opened 4 months ago

liangz1 commented 4 months ago
  1. Installed the demo "llm-rag-chatbot".
  2. Ran the first notebook: 01-Data-Preparation-and-Index.
  3. After pip install, %run ../_resources/00-init $reset_all_data=false failed. No error is shown.
  4. I opened the notebook _resources/00-init, and ran all. Cell 8 failed with error:
    
    ---------------------------------------------------------------------------
    NameError                                 Traceback (most recent call last)
    File <command-2868607934344966>, line 6
      3   spark.sql(f"USE CATALOG `{catalog}`")
      4   spark.sql(f"""create database if not exists `{dbName}` """)
    ----> 6 assert catalog not in ['hive_metastore', 'spark_catalog']
      7 #If the catalog is defined, we force it to the given value and throw exception if not.
      8 if len(catalog) > 0:

NameError: name 'catalog' is not defined

QuentinAmbard commented 4 months ago

hey, this was a bug in the previous version, I think it's fixed in the latest. Can you try to reinstall it we released the fix yesterday ? It should be in 0.3.49

technically there are 2 rows inverted for some reason during the config notebook install, you need to first install the pip and then load the config file, not the other way around

ssmaroju commented 4 months ago

Hi, I get an error when executing in the notebook '01-Data-Preparation-and-Index': %run ../_resources/00-init $reset_all_data=false

The message is: The execution of this command did not finish successfully and has error as below:

Screenshot 2024-02-21 115331

QuentinAmbard commented 4 months ago

hey, from the error you don't have access to the main catalog. Check in the data explorer which catalog is available for you and then install the demo here (catalog="xx"). You need to make sure Unity Catalog is enabled in your workspace!

lynnlangit commented 3 months ago

Please update your demo instructions to include the requirement (and instructions) to configure the Databricks Unity Catalog to be able to use Databricks Vector Search feature. I repro'd the errors shown earlier using an Azure Databricks cluster today for your example application --> https://notebooks.databricks.com/demos/llm-rag-chatbot/index.html#

Exception code shown below:

Exception: Response content b'{"error_code":"BAD_REQUEST","message":"Unity catalog is not enabled for this account or the workspace does not have a metastore attached. Unity Catalog enablement is required for Vector Search. Please enable Unity Catalog and try again later."}', status_code 400
File <command-4168473880346588>, line 5
      2 vsc = VectorSearchClient()
      4 if not endpoint_exists(vsc, VECTOR_SEARCH_ENDPOINT_NAME):
----> 5     vsc.create_endpoint(name=VECTOR_SEARCH_ENDPOINT_NAME, endpoint_type="STANDARD")
      7 wait_for_vs_endpoint_to_be_ready(vsc, VECTOR_SEARCH_ENDPOINT_NAME)
      8 print(f"Endpoint named {VECTOR_SEARCH_ENDPOINT_NAME} is ready.")
QuentinAmbard commented 3 months ago

Hi @lynnlangit, the demo requires Unity Catalog to work indeed, I'll add a note.