databricksdatabricks-clidatabricks-asset-bundle

databricks bundle wheel job add Parameters


Here is an example resources yaml i am using with asset bundle:

 name: "clientscoretestdatageneratorusingparams"
        tasks:
           task_key: "mytask
            python_wheel_task:
              package_name: "workflows"
              entry_point: clientscoretestdatagenerator

I want to add a parameter to this so that I can access it using sys.arg[1].

I have both tried named_parameters (as suggested here) and just parameters.


Solution

  • You might have gone wrong with your syntax somewhere. The parameters field needs to be an array, so something like this should work:

     name: "clientscoretestdatageneratorusingparams"
            tasks:
               task_key: "mytask
                python_wheel_task:
                  package_name: "workflows"
                  entry_point: clientscoretestdatagenerator
                  parameters: ["string1", "string2"]
    

    Also make sure its indentation is correct. It should be 1 indentation level deeper than your python_wheel_task.