dbt-databricks icon indicating copy to clipboard operation
dbt-databricks copied to clipboard

Python models access_control_list argument is not working as intended

Open pamons12 opened this issue 1 year ago • 1 comments

Describe the bug

The access_control_list and python_job_config/grants config options are not working. I did some digging and found the ACLs are being added as a task setting instead of the job itself in the API call.

Steps To Reproduce

Running a python model using the following config

dbt.config(
        materialized='table'
        , python_job_config={'grants': {'run': [{'service_principal_name': 'pamons_test_sp_python_job_config'}]}}
       # OR
        , access_control_list=[{'service_principal_name': 'pamons_test_sp_access_control_list', 'permission_level': 'CAN_MANAGE'}]
        , submission_method='job_cluster'
    )

Expected behavior

Job ACLs specified in the config should be set in the job created by the model

System information

The output of dbt --version:

1.10.1

The operating system you're using: Mac The output of python --version: 3.11.11

Additional context

Link to code The ACL dictionary are in the job_spec var but not in the additional_job_settings var

pamons12 avatar Apr 24 '25 16:04 pamons12

Linking #1014 here — closed as a duplicate of this issue. Same root cause (ACLs attached at task level instead of job level) but #1014 adds a richer repro: both python_job_config.grants and access_control_list config variants, debug-log output showing the ACL payload reaching the API, and a screenshot of the resulting job permissions. Worth a read when revisiting api_client.py:333.

sd-db avatar Apr 21 '26 07:04 sd-db