databricks / run-notebook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notebook extension is stripped off in jobs spec

iandexter opened this issue · comments

Consider the following action.yml:

- name: Run notebook
  uses: databricks/run-notebook@main
  with:
    local-notebook-path: notebooks/test.py
    ...
    git-provider: 'gitHubEnterprise'
    git-commit: ${{ github.sha }}
    ...

The jobs spec in Databricks is:

{
  name: "run tests"
  tasks {
    task_key: "notebook-task"
    task {
      notebook_task {
        notebook_path: "notebooks/test"
      }
    }
    cluster_spec {
      existing_cluster_id: "REDACTED"
    }
  }
  git_source {
    git_url: "REDACTED"
    git_provider: "gitHubEnterprise"
    git_commit: "REDACTED"
  }
}

This results in a job run failure:
Notebook not found: notebooks/test

It may be because the extension is stripped from the local-notebook-path?

Have you seen this known limitation:  

https://github.com/databricks/run-notebook/blob/main/action.yml#L143-L146

Your notebook must be a Databricks notebook exported as a source file. If you are writing a python file outside of Databricks and want to convert it to Databricks notebook format such that it can run as notebook on Databricks using this action follow these instructions https://docs.databricks.com/notebooks/notebooks-manage.html#convert-a-file-to-a-notebook

# Databricks notebook source be the first line in your python file notebooks/test.py

@mohamad-arabi -- I've raised the PR above to clarify this limitation.