Create new job api error "MALFORMED_REQUEST"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 02:29 AM
hi,
i'm trying to test create a new job api (v 2.1) with python, but i got error:
{ 'error_code': 'MALFORMED_REQUEST',
'message': 'Invalid JSON given in the body of the request - expected a map'}
How do i validate json body before posting ?
this is my json
{
"name": "testing job",
"new_cluster": {
"spark_version": "7.3.x-scala2.12",
"node_type_id": "r3.xlarge",
"aws_attributes": {
"availability": "ON_DEMAND"
},
"num_workers": 10
},
"email_notifications": {
"on_start": [],
"on_success": [],
"on_failure": []
},
"timeout_seconds": 3600,
"max_retries": 1,
"schedule": {
"quartz_cron_expression": "0 15 22 * * ?",
"timezone_id": "America/Los_Angeles"
}
}
- Labels:
-
Job
-
MALFORMED REQUEST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 07:12 AM
@tum m It looks Json key-value pairs that you are using seems to be causing issue. spark version is individual key-value pair. that is not a part of object itself (e.g.: you used new cluster and under that you added spark version), please find below examples. as far as i know there is no validation tool to show if object mapping added is right, but syntax wise we have tools like json validator
Clusters API 2.0 | Databricks on AWS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 10:12 AM
thanks 611969, I checked my code again and found some issues with string in json body
Jobs API 2.0 >> https://docs.databricks.com/dev-tools/api/2.0/jobs.html#create
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 05:33 AM
Hi @tum m
Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!