Skip to content

Bug: manage_jobs create fails with 'dict object has no attribute as_dict' when passing optional settings #399

@abhilashdb

Description

@abhilashdb

Summary

manage_jobs(action="create") fails with 'dict' object has no attribute 'as_dict' when any optional dict-based settings parameter is provided (email_notifications, schedule, health, webhook_notifications, notification_settings, queue, run_as, git_source, parameters, deployment).

Root Cause

In databricks_tools_core/jobs/jobs.py, create_job converts tasks, job_clusters, and environments to SDK objects via from_dict() (lines 197-211), but passes all other dict parameters as raw Python dicts to w.jobs.create(**kwargs) (lines 214-237). The SDK internally calls .as_dict() on these during serialization, which fails.

Why update works but create doesn't

update_job merges everything into a single dict, then converts via JobSettings.from_dict() — which handles nested dicts correctly. Create skips this conversion.

Suggested Fix

Convert dict params to SDK types before passing to w.jobs.create(), or build a full settings dict and use JobSettings.from_dict() like update_job does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions