0
0

Databricks Repos 利用時におけるエラー対応:Cannot perform git operation due to conflicting names

Last updated at Posted at 2024-05-24

概要

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.

image.png

Databricks Workspace 上でフォルダと同名のノートブックを作成しようとする下記のようなエラーが発生します。この制約は Databricks の仕様に基づくものであるため、 VS Code などでファイル操作をすることで同名のファイルを作成することができます。その場合に発生するエラーと言えます。

Renaming the element failed: Node named 'test' already exists

image.png

エラーの再現方法

1. Git 上にtest/test.pyのファイルを作成。

空のファイルを作成

image.png

2. Git 上にtest.pyという名称のファイルを作成

下記のコードを記述した python ファイルを作成。

# Databricks notebook source

image.png

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.

image.png

対応方法

1. test.pyのファイル名を変更

_test.pyに名称をを変更。

image.png

2. Git 操作を行い正常に動作することを確認

ブランチを切り替え等により Git のレポジトリーの最新化を実施できることを確認。

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0