Skip to content

Commit d1d2885

Browse files
kz930claude
andauthored
feat(workflow-operator): read the generated module as UTF-8 in three test drivers (apache#8988)
### What changes were proposed in this PR? The Python drivers in `MachineLearningScorerOpDescSpec`, `FilledAreaPlotOpDescSpec` and `TreePlotOpDescSpec` opened the generated module without an encoding, so Python decoded it with the locale's, which is cp1252 on Windows. The spec writes it as UTF-8. Each driver now passes `encoding="utf-8"`, as the drivers that read Plotly HTML already do. ### Any related issues, documentation, discussions? Closes apache#8976 ### How was this PR tested? The three specs pass locally (51 tests). The generated modules are ASCII today, so the change only matters once one is not. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 5a44b5b commit d1d2885

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/machineLearning/Scorer/MachineLearningScorerOpDescSpec.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class MachineLearningScorerOpDescSpec extends AnyFlatSpec with Matchers {
394394
|sys.modules["pytexera"] = stub
395395
|
396396
|ns = {"__name__": "generated_scorer"}
397-
|with open(sys.argv[1]) as f:
397+
|with open(sys.argv[1], encoding="utf-8") as f:
398398
| exec(compile(f.read(), sys.argv[1], "exec"), ns)
399399
|op = ns["ProcessTableOperator"]()
400400
|

‎common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/filledAreaPlot/FilledAreaPlotOpDescSpec.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class FilledAreaPlotOpDescSpec extends AnyFlatSpec with BeforeAndAfter with Matc
271271
|sys.modules["pytexera"] = stub
272272
|
273273
|ns = {"__name__": "generated_filled_area_plot"}
274-
|with open(sys.argv[1]) as f:
274+
|with open(sys.argv[1], encoding="utf-8") as f:
275275
| exec(compile(f.read(), sys.argv[1], "exec"), ns)
276276
|op = ns["ProcessTableOperator"]()
277277
|

‎common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/treeplot/TreePlotOpDescSpec.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class TreePlotOpDescSpec extends AnyFlatSpec with BeforeAndAfter with Matchers {
136136
|sys.modules["pytexera"] = stub
137137
|
138138
|ns = {"__name__": "generated_tree_plot"}
139-
|with open(sys.argv[1]) as f:
139+
|with open(sys.argv[1], encoding="utf-8") as f:
140140
| exec(compile(f.read(), sys.argv[1], "exec"), ns)
141141
|op = ns["ProcessTableOperator"]()
142142
|

0 commit comments

Comments
 (0)