MicrosoftDocs / mslearn_databricks

companion Databricks notebooks for Learn modules
Creative Commons Attribution 4.0 International
26 stars 24 forks source link

name 'userhome' is not defined #6

Open LvffY opened 2 years ago

LvffY commented 2 years ago

Hello

By running the course Process data from Event Hubs with structured streaming, I was asked to execute the notebook 3.Streaming-With-Event-Hubs-Demo.

During this notebook, we need to run the following command

image

Unfortunately, for me this command fails with the error name 'userhome' is not defined.

After some digging, I found that the notebook really missed the initialisation for this variable.

by looking through the other included notebooks, I found that the User-Name notebook contained this initialisation.

As a workaround (I don't know if this is the best solution) I came to modify the notebook Streaming-Demo-Setup like this :

image

I was surprised by this kind of error, but it worked for me ...

Please tell me if anything is not clear

LvffY commented 2 years ago

One more thing : because the rest of the notebook was written in Scala, I had to make another fix on the Streaming-Demo-Setup that is to instantiate our input Dataframe in a Scala cell.

Finally, my notebook looked like this

image

gautamksr commented 2 years ago

I was facing same issues while run the "3.Streaming-With-Event-Hubs" Notebook. The work around, I run the below code %run ./Includes/User-Name at the top, so it will initialize the variable "username" and "userhome"