Open sjraaijmakers opened 3 days ago
Do you have DATABRICKS_PROFILE
env var set in the terminal? This error can happen when we can't identify what profile to use for the auth. By default we look into ~/.databrickscfg
file for the DEFAULT profile, and if we can't find it, then auth fails. You don't need to have DEFAULT profile, and instead specify the name directly in the code like this:
spark = DatabricksSession.builder.profile("<profile-name>").getOrCreate()
I do have a ~/.databrickscfg
with a profile named DEFAULT:
[DEFAULT]
host=MY_HOST
auth_type=databricks-cli
cluster_id=MY_CLUSTER_ID
In the earlier provided error it does seem like Databricks can find this profile (showing MY_HOST and MY_CLUSTER_ID in the provided error). I also tried it with explicitly setting the profile to DEFAULT:
spark = DatabricksSession.builder.profile("DEFAULT").getOrCreate()
without success unfortunately.
I have the same error - terminal pytest works, while vscode plugin doesn't - when running the main_test.py
file that comes with the stub when creating a new databricks project using the databricks-connect plugin
I am using VS code with databricks-connect v2.4.8, and I wrote some pytests. In
conftest.py
I created a fixture:Running the pytest command from within the terminal in the venv works just fine. However, when using the VS code test plugin to discover the tests I get this error:
Anyone any idea on how to solve this?