cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Pyflake errors when using %run

Eeg
New Contributor III

I am using %run command to import shared resources for each of my processes. Because it was the most easy way to import my common libraries. However, in that way, pyflake can't resolve the dependencies quite well. And I end up working in code with many red lines populated by pyflake. I have attached just one pyflake dependency error.

Is there a way for pyflake to load code which been loaded using %run magic command? Or in general how are you guys handling common utility file aside from the main processing file inside databricks?

7 REPLIES 7

Eeg
New Contributor III

The visualization of the problem I am referencing:

btafur
Contributor III
Contributor III

You could use something like flake8 and customize the rules in the .flake8 file or ignore specific lines with #noqa.

https://flake8.pycqa.org/en/latest/user/configuration.html

Eeg
New Contributor III

Thank you for your reply, it's definetaly a way not to see the red lines.

However I am not sure it's a feasible way.

It would be best if there's a way a code formatter could detect classes and imports from file which loaded to databricks by %run command.

Kaniz_Fatma
Community Manager
Community Manager

Hi @Eeg , Would you like to raise a request?

 

Eeg
New Contributor III

Kaniz_Fatma
Community Manager
Community Manager

Yes, Indeed.

Kaniz_Fatma
Community Manager
Community Manager

Hi @Eeg We haven't heard from you since the last response from @btafur, and I was checking back to see if his suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others.

Also, Please don't forget to click on the "Accept as Solution" button whenever the information provided helps resolve your question.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group