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:ย 

How to run the .py file in databricks cluster

data_engineer_0
New Contributor II

Hi team,

I wants to run the below command in databricks and also need to capture the error and success message.

Please help me out here,Thanks in advance

Ex: python3 /mnt/users/code/x.py --arguments

3 REPLIES 3

Hubert-Dudek
Esteemed Contributor III

When you use repo you can enable "files in repo" and then just import class in notebook and init it.

from file_folder.file_name import your_class

c = your_class(arguments)

Anonymous
Not applicable

@kalyan pโ€‹ - Did @Hubert Dudekโ€‹'s answer help solve the issue?

User16764241763
Honored Contributor

Hello @Piper Wilsonโ€‹ 

Would this task not help?

https://docs.databricks.com/dev-tools/api/latest/examples.html#jobs-api-examples

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