Fix Python linting issues - remove whitespace and add newline

This commit is contained in:
Bahadir Ciloglu 2025-11-01 15:55:35 +03:00
parent 68f8909470
commit 2a6c31f4fb

View File

@ -216,7 +216,7 @@ def handler(job: Dict[str, Any]) -> Dict[str, Any]:
# Download input files if any # Download input files if any
local_files = handler_instance.download_input_files(job_input) local_files = handler_instance.download_input_files(job_input)
# Update workflow with local file paths # Update workflow with local file paths
workflow = job_input.get("workflow", {}) workflow = job_input.get("workflow", {})
if local_files and "file_mappings" in job_input: if local_files and "file_mappings" in job_input:
@ -225,10 +225,10 @@ def handler(job: Dict[str, Any]) -> Dict[str, Any]:
for input_key, file_key in mappings.items(): for input_key, file_key in mappings.items():
if file_key in local_files: if file_key in local_files:
workflow[node_id]["inputs"][input_key] = local_files[file_key] workflow[node_id]["inputs"][input_key] = local_files[file_key]
# Execute workflow # Execute workflow
results = handler_instance.execute_workflow(workflow) results = handler_instance.execute_workflow(workflow)
# Upload output files to RunPod storage or return base64 # Upload output files to RunPod storage or return base64
output_urls = [] output_urls = []
for output in results.get("outputs", []): for output in results.get("outputs", []):
@ -242,20 +242,20 @@ def handler(job: Dict[str, Any]) -> Dict[str, Any]:
"data": image_data, "data": image_data,
"node_id": output["node_id"] "node_id": output["node_id"]
}) })
return { return {
"status": "success", "status": "success",
"outputs": output_urls, "outputs": output_urls,
"execution_time": time.time() - job.get("start_time", time.time()) "execution_time": time.time() - job.get("start_time", time.time())
} }
except Exception as e: except Exception as e:
logger.error(f"Handler error: {str(e)}") logger.error(f"Handler error: {str(e)}")
return { return {
"error": str(e), "error": str(e),
"status": "failed" "status": "failed"
} }
finally: finally:
# Always cleanup # Always cleanup
handler_instance.cleanup() handler_instance.cleanup()