Copilot commented on code in PR #4369:
URL: https://github.com/apache/texera/pull/4369#discussion_r3070475573


##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/scan/file/InputFileScanSourceOpDesc.scala:
##########
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.source.scan.file
+
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.kjetland.jackson.jsonSchema.annotations.{
+  JsonSchemaInject,
+  JsonSchemaString,
+  JsonSchemaTitle
+}
+import org.apache.texera.amber.core.executor.OpExecWithClassName
+import org.apache.texera.amber.core.tuple.{AttributeType, Schema}
+import org.apache.texera.amber.core.virtualidentity.{ExecutionIdentity, 
WorkflowIdentity}
+import org.apache.texera.amber.core.workflow.{
+  InputPort,
+  OutputPort,
+  PhysicalOp,
+  SchemaPropagationFunc
+}
+import org.apache.texera.amber.operator.metadata.annotations.HideAnnotation
+import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants, 
OperatorInfo}
+import org.apache.texera.amber.operator.source.SourceOperatorDescriptor
+import org.apache.texera.amber.operator.source.scan.FileDecodingMethod
+import org.apache.texera.amber.operator.source.scan.text.TextSourceOpDesc
+import org.apache.texera.amber.util.JSONUtils.objectMapper
+
+class InputFileScanSourceOpDesc extends SourceOperatorDescriptor with 
TextSourceOpDesc {
+  @JsonProperty(defaultValue = "UTF_8", required = true)
+  @JsonSchemaTitle("Encoding")
+  var fileEncoding: FileDecodingMethod = FileDecodingMethod.UTF_8
+
+  @JsonProperty(defaultValue = "false")
+  @JsonSchemaTitle("Extract")
+  val extract: Boolean = false
+
+  @JsonProperty(defaultValue = "false")
+  @JsonSchemaTitle("Include Filename")
+  @JsonSchemaInject(
+    strings = Array(
+      new JsonSchemaString(path = HideAnnotation.hideTarget, value = 
"extract"),
+      new JsonSchemaString(path = HideAnnotation.hideType, value = 
HideAnnotation.Type.equals),
+      new JsonSchemaString(path = HideAnnotation.hideExpectedValue, value = 
"false")
+    )
+  )
+  val outputFileName: Boolean = false

Review Comment:
   `extract` and `outputFileName` are declared as `val`, which makes them 
effectively immutable from the operator configuration JSON and prevents 
users/UI from toggling these options. If these are intended to be 
user-configurable (they have `@JsonProperty` / schema annotations), they should 
be `var` (or otherwise deserializable) or removed from the schema/UI if 
intentionally fixed to `false`.



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