zyratlo commented on code in PR #7741:
URL: https://github.com/apache/texera/pull/7741#discussion_r3817050422
##########
notebook-migration-service/src/main/scala/org/apache/texera/service/resource/NotebookMigrationResource.scala:
##########
@@ -251,6 +234,62 @@ object NotebookMigrationResource extends LazyLogging {
}
}
+ // Delete the notebook file from Jupyter's work/ directory:
+ def deleteNotebook(body: String): Response = {
+ var conn: HttpURLConnection = null
+ try {
+ val json = mapper.readTree(body)
+
+ // Read the name defensively
+ val notebookName =
+
Option(json.get("notebookName")).filter(_.isTextual).map(_.asText()).getOrElse("")
Review Comment:
Fixed in
[88f7ec6](https://github.com/apache/texera/pull/7741/commits/88f7ec6ea14d06dbc94803e1345a7c9479c193d0).
I added a shared parseBody helper that returns 400 on malformed JSON or a
non-object root, and routed all five endpoints (setNotebook, deleteNotebook,
storeNotebookAndMapping, fetchNotebookAndMapping, deleteNotebookAndMapping)
through it, so the classification is consistent across the resource. The
generic 500 catch stays for real downstream failures. Malformed-body tests now
expect 400.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]