You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/06/18 01:46:07 UTC

[PR] test(workflow-operator): add unit test coverage for SplitOp and UrlVizOp (descriptor + executor pairs) [texera]

aglinxinyuan opened a new pull request, #5769:
URL: https://github.com/apache/texera/pull/5769

   ### What changes were proposed in this PR?
   
   Pin behavior of two previously-uncovered standalone operators (descriptor + executor pairs). No production-code changes.
   
   | Spec | Source class | Tests |
   | --- | --- | --- |
   | `SplitOpDescSpec` | `SplitOpDesc` | 8 |
   | `SplitOpExecSpec` | `SplitOpExec` | 7 |
   | `UrlVizOpDescSpec` | `UrlVizOpDesc` | 7 |
   | `UrlVizOpExecSpec` | `UrlVizOpExec` | 6 |
   
   All four spec files follow the `<srcClassName>Spec.scala` one-to-one convention.
   
   **Behavior pinned — `SplitOpDesc`**
   
   | Surface | Contract |
   | --- | --- |
   | `operatorInfo` | name `"Split"`, group `UTILITY_GROUP`, one input, two outputs (PortIdentity 0 = training, PortIdentity 1 = testing) |
   | Field defaults | `k = 80`, `random = true`, `seed = 1` |
   | `getPhysicalOp` | wires `OpExecWithClassName("…operator.split.SplitOpExec", <json>)`; non-parallelizable; payload includes the `k` / `random` / `seed` wire-keys |
   | Schema propagation | propagates the single input schema to every output port; throws `IllegalArgumentException` unless exactly one input is supplied |
   | Independent instances | `operatorIdentifier` (UUID-seeded) differs across `new` |
   
   **Behavior pinned — `SplitOpExec`**
   
   | Surface | Contract |
   | --- | --- |
   | `k = 100` | every tuple emitted on PortIdentity 0 (training) |
   | `k = 0` | every tuple emitted on PortIdentity 1 (testing) |
   | Deterministic seed | two fresh instances with the same `(k, seed)` produce identical port sequences over 200 tuples |
   | `k = 50` (deterministic seed) | ~50% ratio over 2000 tuples (±150 band — safely outside binomial 3σ ≈ 67) |
   | `close()` | clears the `random` reference to `null` |
   | `processTuple` (single-port overload) | throws `NotImplementedError` |
   | Malformed descriptor JSON | construction throws `JsonProcessingException` |
   
   **Behavior pinned — `UrlVizOpDesc`**
   
   | Surface | Contract |
   | --- | --- |
   | `operatorInfo` | name `"URL Visualizer"`, group `VISUALIZATION_MEDIA_GROUP` |
   | `getPhysicalOp` | wires `OpExecWithClassName("…operator.visualization.urlviz.UrlVizOpExec", <json>)` |
   | Output schema | propagation function ignores input and emits a single `html-content` STRING attribute |
   | `urlContentAttrName` annotations | `@JsonProperty(required = true)` + `@AutofillAttributeName` + `@NotNull` (verified via reflection) |
   | Class-level `@JsonSchemaInject` | restricts `urlContentAttrName` to STRING attributes |
   | Independent instances | `operatorIdentifier` (UUID-seeded) differs across `new` |
   
   **Behavior pinned — `UrlVizOpExec`**
   
   | Surface | Contract |
   | --- | --- |
   | `processTuple` | emits a single `TupleLike` whose only value contains the generated HTML |
   | Generated HTML | `<!DOCTYPE html>` preamble; `<iframe src="…">` interpolates the input URL; `frameborder="0"` and the `height:100vh; width:100%; border:none` sizing style |
   | Per-tuple cardinality | exactly one emission per `processTuple` call |
   | Distinct URLs | interpolated into distinct outputs |
   | Malformed descriptor JSON | construction throws `JsonProcessingException` |
   
   **Test-harness note**
   
   `UrlVizOpDesc` declares `urlContentAttrName: val = ""`; the production code seeds it via `objectMapper.readValue` and the `jackson-module-no-ctor-deser` module that bypasses immutable vals. To test the executor without touching production code, `UrlVizOpExecSpec` builds the descriptor JSON via Jackson's tree API and injects both the `operatorType` discriminator (`"URLVisualizer"`, per `LogicalOp`'s `@JsonSubTypes` table) and the `urlContentAttrName` field.
   
   ### Any related issues, documentation, discussions?
   
   Closes #5766.
   
   ### How was this PR tested?
   
   Pure unit-test additions; verified locally with:
   
   - `sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.split.SplitOpDescSpec org.apache.texera.amber.operator.split.SplitOpExecSpec org.apache.texera.amber.operator.visualization.urlviz.UrlVizOpDescSpec org.apache.texera.amber.operator.visualization.urlviz.UrlVizOpExecSpec"` — 30 tests, all green
   - `sbt scalafmtCheckAll` — clean
   - CI to confirm
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.7 [1M context])


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(workflow-operator): add unit test coverage for SplitOp and UrlVizOp (descriptor + executor pairs) [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5769:
URL: https://github.com/apache/texera/pull/5769#issuecomment-4737112027

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/5769?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 53.27%. Comparing base ([`715bccc`](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`456d291`](https://app.codecov.io/gh/apache/texera/commit/456d291ca009d076ff1d6a42df452647b9e66891?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff            @@
   ##               main    #5769   +/-   ##
   =========================================
     Coverage     53.27%   53.27%           
     Complexity     2660     2660           
   =========================================
     Files          1095     1095           
     Lines         42398    42398           
     Branches       4560     4560           
   =========================================
     Hits          22587    22587           
     Misses        18479    18479           
     Partials       1332     1332           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
   |---|---|---|---|
   | [access-control-service](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.44% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [agent-service](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.36% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [amber](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.66% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `1.65% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [config-service](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.71% <ø> (ø)` | | |
   | [file-service](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.06% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [frontend](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.02% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [pyamber](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.13% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [python](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.80% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/5769/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.69% <ø> (ø)` | | Carriedforward from [715bccc](https://app.codecov.io/gh/apache/texera/commit/715bccc22278a7c8a91ba00014550e8d8d011947?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/5769?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(workflow-operator): add unit test coverage for SplitOp and UrlVizOp (descriptor + executor pairs) [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #5769:
URL: https://github.com/apache/texera/pull/5769


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(workflow-operator): add unit test coverage for SplitOp and UrlVizOp (descriptor + executor pairs) [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5769:
URL: https://github.com/apache/texera/pull/5769#issuecomment-4737125365

   <!-- texera-benchmarks-comment -->
   ## ⚠️ Benchmark changes need a look
   
   🟢 0 better · 🔴 3 worse · ⚪ 12 noise (<±5%) · 0 without baseline
   
   > Compared against main `715bccc` benchmarked on **this same runner**, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.
   
   [Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/27731316597)
   
   | | config | throughput | MB/s | latency | max Δ latest / 7d |
   |---|---|---:|---:|---:|---:|
   | 🔴 | bs=10 sw=10 sl=64 | 382 | 0.233 | 25,748/35,814/35,814 us | 🔴 +14.9% / 🔴 +8.3% |
   | ⚪ | bs=100 sw=10 sl=64 | 795 | 0.485 | 123,709/155,191/155,191 us | ⚪ within ±5% / 🔴 +11.0% |
   | ⚪ | bs=1000 sw=10 sl=64 | 922 | 0.563 | 1,079,222/1,135,795/1,135,795 us | ⚪ within ±5% / 🔴 -11.4% |
   
   <details><summary>Baseline details</summary>
   
   Latest main `715bccc` from same runner
   
   | config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
   |---|---|---:|---:|---:|---:|---:|
   | bs=10 sw=10 sl=64 | throughput | 382 tuples/sec | 413 tuples/sec | 410.82 tuples/sec | -7.5% | -7.0% |
   | bs=10 sw=10 sl=64 | MB/s | 0.233 MB/s | 0.252 MB/s | 0.251 MB/s | -7.5% | -7.1% |
   | bs=10 sw=10 sl=64 | p50 | 25,748 us | 22,404 us | 23,785 us | +14.9% | +8.3% |
   | bs=10 sw=10 sl=64 | p95 | 35,814 us | 34,721 us | 34,980 us | +3.1% | +2.4% |
   | bs=10 sw=10 sl=64 | p99 | 35,814 us | 34,721 us | 34,980 us | +3.1% | +2.4% |
   | bs=100 sw=10 sl=64 | throughput | 795 tuples/sec | 817 tuples/sec | 891.94 tuples/sec | -2.7% | -10.9% |
   | bs=100 sw=10 sl=64 | MB/s | 0.485 MB/s | 0.499 MB/s | 0.544 MB/s | -2.8% | -10.9% |
   | bs=100 sw=10 sl=64 | p50 | 123,709 us | 120,713 us | 112,277 us | +2.5% | +10.2% |
   | bs=100 sw=10 sl=64 | p95 | 155,191 us | 156,958 us | 139,802 us | -1.1% | +11.0% |
   | bs=100 sw=10 sl=64 | p99 | 155,191 us | 156,958 us | 139,802 us | -1.1% | +11.0% |
   | bs=1000 sw=10 sl=64 | throughput | 922 tuples/sec | 911 tuples/sec | 1,041 tuples/sec | +1.2% | -11.4% |
   | bs=1000 sw=10 sl=64 | MB/s | 0.563 MB/s | 0.556 MB/s | 0.635 MB/s | +1.3% | -11.4% |
   | bs=1000 sw=10 sl=64 | p50 | 1,079,222 us | 1,103,186 us | 972,714 us | -2.2% | +10.9% |
   | bs=1000 sw=10 sl=64 | p95 | 1,135,795 us | 1,134,662 us | 1,023,057 us | +0.1% | +11.0% |
   | bs=1000 sw=10 sl=64 | p99 | 1,135,795 us | 1,134,662 us | 1,023,057 us | +0.1% | +11.0% |
   
   </details>
   
   <details><summary>Raw CSV</summary>
   
   ```csv
   config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
   0,10,10,64,20,523.42,200,128000,382,0.233,25747.73,35814.16,35814.16
   1,100,10,64,20,2516.77,2000,1280000,795,0.485,123708.51,155191.36,155191.36
   2,1000,10,64,20,21693.91,20000,12800000,922,0.563,1079222.44,1135794.55,1135794.55
   ```
   
   </details>
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(workflow-operator): add unit test coverage for SplitOp and UrlVizOp (descriptor + executor pairs) [texera]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #5769:
URL: https://github.com/apache/texera/pull/5769#discussion_r3432507447


##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/urlviz/UrlVizOpExecSpec.scala:
##########
@@ -0,0 +1,121 @@
+/*
+ * 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.visualization.urlviz
+
+import org.apache.texera.amber.core.tuple.{Attribute, AttributeType, Schema, Tuple, TupleLike}
+import org.apache.texera.amber.util.JSONUtils.objectMapper
+import org.scalatest.flatspec.AnyFlatSpec
+
+class UrlVizOpExecSpec extends AnyFlatSpec {
+
+  // ---------------------------------------------------------------------------
+  // Fixtures
+  // ---------------------------------------------------------------------------
+
+  private val attr = new Attribute("url", AttributeType.STRING)
+  private val schema: Schema = Schema().add(attr)
+  private def tuple(url: String): Tuple =
+    Tuple.builder(schema).add(attr, url).build()
+
+  /**
+    * Build a descriptor JSON for `UrlVizOpExec`. The production class
+    * declares `urlContentAttrName` as a `val` initialized to `""`; the
+    * Jackson-`module-no-ctor-deser` module bypasses the val and writes
+    * to the underlying field via reflection, so the spec can supply
+    * any attribute name through the JSON wire-key.
+    *
+    * LogicalOp carries `@JsonTypeInfo(property = "operatorType")`, so
+    * the JSON must include the `operatorType` discriminator (value
+    * `"URLVisualizer"` per LogicalOp's `@JsonSubTypes` table).
+    */
+  private def descJson(urlAttr: String): String = {
+    val node = objectMapper.createObjectNode()
+    node.put("operatorType", "URLVisualizer")
+    node.put("urlContentAttrName", urlAttr)
+    node.toString
+  }
+
+  private def runSingle(exec: UrlVizOpExec, t: Tuple): String = {
+    val out = exec.processTuple(t, port = 0).toList
+    assert(out.size == 1, s"expected one emission, got: $out")
+    out.head match {
+      case tupleLike: TupleLike =>
+        // The first field of the emitted TupleLike is the generated HTML.
+        tupleLike.getFields.head.toString
+    }
+  }

Review Comment:
   `runSingle` currently uses `getFields.head.toString` without asserting the emitted `TupleLike` has exactly one field and that the field is actually a `String`. This can let the test pass even if the executor emits additional fields or a non-string value that happens to have a matching `toString` output.



-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(workflow-operator): add unit test coverage for SplitOp and UrlVizOp (descriptor + executor pairs) [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan commented on code in PR #5769:
URL: https://github.com/apache/texera/pull/5769#discussion_r3432538359


##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/urlviz/UrlVizOpExecSpec.scala:
##########
@@ -0,0 +1,121 @@
+/*
+ * 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.visualization.urlviz
+
+import org.apache.texera.amber.core.tuple.{Attribute, AttributeType, Schema, Tuple, TupleLike}
+import org.apache.texera.amber.util.JSONUtils.objectMapper
+import org.scalatest.flatspec.AnyFlatSpec
+
+class UrlVizOpExecSpec extends AnyFlatSpec {
+
+  // ---------------------------------------------------------------------------
+  // Fixtures
+  // ---------------------------------------------------------------------------
+
+  private val attr = new Attribute("url", AttributeType.STRING)
+  private val schema: Schema = Schema().add(attr)
+  private def tuple(url: String): Tuple =
+    Tuple.builder(schema).add(attr, url).build()
+
+  /**
+    * Build a descriptor JSON for `UrlVizOpExec`. The production class
+    * declares `urlContentAttrName` as a `val` initialized to `""`; the
+    * Jackson-`module-no-ctor-deser` module bypasses the val and writes
+    * to the underlying field via reflection, so the spec can supply
+    * any attribute name through the JSON wire-key.
+    *
+    * LogicalOp carries `@JsonTypeInfo(property = "operatorType")`, so
+    * the JSON must include the `operatorType` discriminator (value
+    * `"URLVisualizer"` per LogicalOp's `@JsonSubTypes` table).
+    */
+  private def descJson(urlAttr: String): String = {
+    val node = objectMapper.createObjectNode()
+    node.put("operatorType", "URLVisualizer")
+    node.put("urlContentAttrName", urlAttr)
+    node.toString
+  }
+
+  private def runSingle(exec: UrlVizOpExec, t: Tuple): String = {
+    val out = exec.processTuple(t, port = 0).toList
+    assert(out.size == 1, s"expected one emission, got: $out")
+    out.head match {
+      case tupleLike: TupleLike =>
+        // The first field of the emitted TupleLike is the generated HTML.
+        tupleLike.getFields.head.toString
+    }
+  }

Review Comment:
   Good catch — tightened in 3f38f84. `runSingle` now asserts `fields.size == 1` and `field.isInstanceOf[String]` before returning, so a regression emitting additional fields or a non-string value would fail loudly instead of silently passing through `toString`.



-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org