Skip to content

requirements.txt relative path not replaced correctly when used in serverless dependency #2849

@nscipione-sumer

Description

@nscipione-sumer

Describe the issue

We're using serverless compute to run DAB jobs, and a requirements.txt to create the python environment.

Configuration

resources:
  jobs:
    run_tests_job:
      name: run_tests_job
      tasks:
        - task_key: start_test_runner
          spark_python_task:
            python_file: ../tests/run_pytest.py
          environment_key: default
      environments:
        - environment_key: default
          spec:
            client: '1'
            dependencies:
              - "-r ../requirements.txt"  # Problem line

My current workaround is to replace the problem line with - "-r ${workspace.file_path}/requirements.txt"

Steps to reproduce the behavior

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

  1. Run databricks bundle validate works correctly
  2. Run databricks bundle deploy to see the error:
Error: file doesn't exist ./resources/-r ../requirements.txt
  at resources.jobs.run_tests_job.environments[0].spec.dependencies[0]
  in resources/run_tests_job.yml:15:17

Expected Behavior

The relative path should work in the same way as the python_file.

Actual Behavior

The asset bundle's configuration is being not being parsed correctly, possibly due to the -r flag

OS and CLI version

0.251.0
Linux

Is this a regression?

No. Similar issue: #1751

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions