databricks-cli icon indicating copy to clipboard operation
databricks-cli copied to clipboard

databricks workspace import(_dir) should not automatically convert non-notebook .py files to notebooks

Open cloudyday opened this issue 2 years ago • 3 comments

On the Databricks platform, it is possible to use regular python modules in Repos and Workspaces. It is even suggested by Databricks to use typical software engineering best practises. Here and here.

However, when using the Databricks CLI for importing files, especially a directory, into a Workspace by using databricks workspace import_dir, all .py files get automatically transformed to notebooks. This makes them incompatible because they cannot be imported as modules anymore.

The import and import_dir commands should probably only convert .py files starting with # Databricks notebook source to notebooks.

cloudyday avatar Mar 20 '23 09:03 cloudyday

Glad to know I am not the only one, I opened this issue before realising you had already raised this concern.

https://github.com/databricks/databricks-cli/issues/630

fferegrino avatar Apr 25 '23 15:04 fferegrino

I've just created a PR to help tackle this problem.

#643

osuleiman avatar May 17 '23 11:05 osuleiman