概要
Databricks Repos 利用時にて、ブランチの切り替え、あるいは、 Repo の作成時に下記のエラーが発生した場合の対応方法を共有します。原因としては、Databricks ノートブック(# Databricks notebook source
ではじまる python ファイル)と同名のフォルダを同一ディレクトリに配置できないことです。ファイル名を変更する対応が必要となります。
Error checking out branch
Cannot perform git operation due to conflicting names: paths ['test', 'test.py'] would all become 'test'; A folder cannot contain a notebook with the same name as another notebook, file, or folder (excluding file extensions). Please change the name of one of your notebooks, files, or folders.
Databricks Workspace 上でフォルダと同名のノートブックを作成しようとする下記のようなエラーが発生します。この制約は Databricks の仕様に基づくものであるため、 VS Code などでファイル操作をすることで同名のファイルを作成することができます。その場合に発生するエラーと言えます。
Renaming the element failed: Node named 'test' already exists
エラーの再現方法
1. Git 上にtest/test.py
のファイルを作成。
空のファイルを作成
2. Git 上にtest.py
という名称のファイルを作成
下記のコードを記述した python ファイルを作成。
# Databricks notebook source
3. Databricks Repos にてレポジトリーを確認するとエラーが発生
Databricks にてブランチの切り替え操作などを実施すると下記のエラーが発生。
Error checking out branch
Cannot perform git operation due to conflicting names: paths ['test', 'test.py'] would all become 'test'; A folder cannot contain a notebook with the same name as another notebook, file, or folder (excluding file extensions). Please change the name of one of your notebooks, files, or folders.
対応方法
1. test.py
のファイル名を変更
_test.py
に名称をを変更。
2. Git 操作を行い正常に動作することを確認
ブランチを切り替え等により Git のレポジトリーの最新化を実施できることを確認。