Error: Running Python code is not allowed when DATABRICKS_BUNDLE_RESTRICTED_CODE_EXECUTION is set

Open
#2,968 10 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, python
Domain
cli

Research direction

Reproduce the issue with the experimental_job_as_code template: run databricks bundle init, open the bundle in the Databricks UI, and inspect the Deployments tab. Compare the behavior with the restriction introduced by PR #2598; done means the UI shows the list of objects to be generated instead of the Python execution error.

Written by the indexing model from the issue text.

Description

DABs No Autoclose
Describe the issue

When running a DAB which is job as code using the Databricks UI, the following error is thrown:
Error: Running Python code is not allowed when DATABRICKS_BUNDLE_RESTRICTED_CODE_EXECUTION is set
This is introduced by https://github.com/databricks/cli/pull/2598

Configuration

Create a DAB from the job as code template and try to run it using the Databricks UI

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. In a Datzbricks terminal, run databricks bundle init, select experimental_job_as_code as template
  2. Open the created DAB in the Databricks UI
  3. Open the Deployments tab
  4. See error: Error: Running Python code is not allowed when DATABRICKS_BUNDLE_RESTRICTED_CODE_EXECUTION is set
Expected Behavior

A list of to be generated objects should be shown

Actual Behavior

The error appears

OS and CLI version

No compute is selected. This runs on Databricks infrastructure

Is this a regression?

This is introduced by https://github.com/databricks/cli/pull/2598

Debug Logs
Dominant language
Go
Stars
427
Forks
267
Avg merge
2d 1h
Merged PRs (30d)
233

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/cli

All issues in databricks/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.