databricks-cli/bundle/config/mutator/python
Gleb Kanterov ed448815b4
PythonMutator: explain missing package error (#1736)
## Changes
Explain the error when the `databricks-pydabs` package is not installed
or the Python environment isn't correctly activated.

Example output:

```
Error: python mutator process failed: ".venv/bin/python3 -m databricks.bundles.build --phase load --input .../input.json --output .../output.json --diagnostics .../diagnostics.json: exit status 1", use --debug to enable logging

.../.venv/bin/python3: Error while finding module specification for 'databricks.bundles.build' (ModuleNotFoundError: No module named 'databricks')

Explanation: 'databricks-pydabs' library is not installed in the Python environment.

If using Python wheels, ensure that 'databricks-pydabs' is included in the dependencies, 
and that the wheel is installed in the Python environment:

  $ .venv/bin/pip install -e .

If using a virtual environment, ensure it is specified as the venv_path property in databricks.yml, 
or activate the environment before running CLI commands:

  experimental:
    pydabs:
      venv_path: .venv
```

## Tests
Unit tests
2024-09-02 09:49:30 +00:00
..
log_writer.go Add ApplyPythonMutator (#1430) 2024-06-20 08:43:08 +00:00
python_diagnostics.go Support multiple paths for diagnostics (#1616) 2024-07-25 15:16:27 +00:00
python_diagnostics_test.go Support multiple paths for diagnostics (#1616) 2024-07-25 15:16:27 +00:00
python_mutator.go PythonMutator: explain missing package error (#1736) 2024-09-02 09:49:30 +00:00
python_mutator_test.go PythonMutator: explain missing package error (#1736) 2024-09-02 09:49:30 +00:00