diff --git a/src/cddp/__init__.py b/src/cddp/__init__.py index 3823432..b913bcd 100644 --- a/src/cddp/__init__.py +++ b/src/cddp/__init__.py @@ -357,8 +357,7 @@ def load_sample_data(spark, data_str, format="json"): table_name = "tmp_"+str(uuid.uuid4()).replace("-", "") df.createOrReplaceTempView("tmp_"+table_name) df = spark.sql("select * from tmp_"+table_name + " limit "+str(25)) - data = df.toJSON().map(lambda j: json.loads(j)).collect() - json_str = json.dumps(data) + json_str = df.toPandas().to_json(orient='records') schema = df.schema.json() return json_str, schema diff --git a/src/cddp/dbxapi.py b/src/cddp/dbxapi.py index 3de9800..7841df8 100644 --- a/src/cddp/dbxapi.py +++ b/src/cddp/dbxapi.py @@ -111,8 +111,9 @@ def build_tasks(config, working_dir, config_path, dbx_cluster): task_obj["depends_on"].append({"task_key": standard_gate["task_key"]}) tasks.append(task_obj) for dep in dependency: - if(config["standard"][dep]["type"] == "batch"): - task_obj["depends_on"].append({"task_key": dep}) + for std_conf in config["standard"]: + if(std_conf["name"] == dep and std_conf["type"] == "batch"): + task_obj["depends_on"].append({"task_key": dep}) for task in config["serving"]: type = task["type"] @@ -122,8 +123,9 @@ def build_tasks(config, working_dir, config_path, dbx_cluster): task_obj["depends_on"].append({"task_key": serving_gate["task_key"]}) tasks.append(task_obj) for dep in dependency: - if(config["serving"][dep]["type"] == "batch"): - task_obj["depends_on"].append({"task_key": dep}) + for srv_conf in config["serving"]: + if(srv_conf["name"] == dep and srv_conf["type"] == "batch"): + task_obj["depends_on"].append({"task_key": dep}) return tasks diff --git a/web/index.js b/web/index.js index 848067d..5a38d00 100644 --- a/web/index.js +++ b/web/index.js @@ -457,7 +457,7 @@ var app = new Vue({ } } else if (this.currentPipelineStandardTask['code']['lang'] == 'python') { this.initStandardPyEditor() - if(that.standardPyEditor==null) { + if(that.standardPyEditor != null) { setTimeout(function () { if (!that.currentPipelineStandardTask['code']['python']) { that.currentPipelineStandardTask['code']['python'] = "" @@ -507,7 +507,7 @@ var app = new Vue({ } } else if (this.currentPipelineServingTask['code']['lang'] == 'python') { this.initServingPyEditor() - if(that.servingPyEditor==null) { + if(that.servingPyEditor != null) { setTimeout(function () { if (!that.currentPipelineServingTask['code']['python']) { that.currentPipelineServingTask['code']['python'] = ""