tanishqgandhi1908 commented on code in PR #6869:
URL: https://github.com/apache/texera/pull/6869#discussion_r3779937954


##########
file-service/src/main/scala/org/apache/texera/service/type/dataset/DatasetFileNode.scala:
##########
@@ -81,15 +81,20 @@ object DatasetFileNode {
   ): List[DatasetFileNode] = {
     val rootNode = new DatasetFileNode("/", "directory", null, "")
 
+    // Root the tree at the datasets prefix node (a directory node named 
"datasets").
+    val datasetsNode =
+      new DatasetFileNode(ResourceType.Datasets.toString, "directory", 
rootNode, "")
+    rootNode.children = Some(List(datasetsNode))
+
     // Owner level nodes map
     val ownerNodes = mutable.Map[String, DatasetFileNode]()
 
     map.foreach {
       case ((ownerEmail, datasetName, versionName), objects) =>
         val ownerNode = ownerNodes.getOrElseUpdate(
           ownerEmail, {
-            val newNode = new DatasetFileNode(ownerEmail, "directory", 
rootNode, ownerEmail)
-            rootNode.children = Some(rootNode.getChildren :+ newNode)
+            val newNode = new DatasetFileNode(ownerEmail, "directory", 
datasetsNode, ownerEmail)
+            datasetsNode.children = Some(datasetsNode.getChildren :+ newNode)

Review Comment:
   Agreed. What's in this diff is only a rename — the tree gained a root 
segment for the resource-type prefix, so rootNode became datasetsNode.
   
   It changes once models use this builder. So I'll do the real fix in the 
model version-upload PR (which is next PR), where this gets its second caller. 
Take the resource type as a parameter, rename to resource-neutral names. 



-- 
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]

Reply via email to