0

I am trying to pass an JSON String to External Function. However, seems like it's not able to consider this as valid argument.

Following works perfectly find is Shell Script

old_config=`databricks clusters get --cluster-id $cluster_id`
databricks clusters edit --json "${old_config}"

However, Following throws and Error in PowerShell

$OldConfig=databricks clusters get --cluster-id $ClusterID
databricks clusters edit --json "${OldConfig}"

Error

PS Azure:\>   databricks clusters edit --json "$OldConfig" --debug
HTTP debugging enabled
Usage: databricks clusters edit [OPTIONS]
Try "databricks clusters edit -h" for help.

Error: Got unexpected extra arguments (cluster terminated (inactive for 15 minutes).,    autotermination_minutes: 15,    terminated_time: 1575562085278,    spark_conf: {spark.databricks.cluster.profile: serverless,      spark.databricks.io.cache.enabled: false,      spark.databricks.repl.allowedLanguages: sql,python,r,      spark.databricks.io.cache.maxMetaDataCache: 0,      spark.databricks.delta.preview.enabled: true,      spark.driver.maxResultSize: 7GB   },    driver_node_type_id: Standard_DS4_v2,    last_state_loss_time: 1575561173235,    start_time: 1566998040228,    termination_reason: {     code: INACTIVITY,      parameters: {       inactivity_duration_min: 15     }   },custom_tags: {     cluster_name: GatewayCluster,      ResourceClass: Serverless,      cluster_id: 0828-11122-ddi3i3   },    cluster_name: GatewayCluster,    init_scripts_safe_mode: false,    state: TERMINATED,    spark_version: 5.5.x-scala2.11,    cluster_id: 0828-131400-dents910,    creator_user_name: abc@xyz.com,    default_tags: {     ClusterName: GatewayCluster,      ClusterId: 0828-11122-ddi3i3,      Vendor: Databricks,      Creator: abc@xyx.com   },    cluster_source: UI,  autoscale: {     max_workers: 20,      min_workers: 7   },    spark_context_id: 11299222 })
(.venv) Azure:/
Gaurang Shah
  • 11,764
  • 9
  • 74
  • 137

0 Answers0