Skip to content

Rename PythonCodegenBase to a HuggingFace-scoped name for clarity #7140

Description

@PG1204

Task Summary

Rename the PythonCodegenBase object (and its file + spec) to HuggingFaceCodegenBase so its scope is clear. Pure internal rename, no behavior change.

Context

PythonCodegenBase reads like a generic, cross-operator base for Python code generation, but it isn't. It lives in common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/codegen/, is referenced only within that package, and "Base" refers to it being the shared base of the Hugging Face per-task codegens, the TaskCodegen implementations (TextGenCodegen, ImageTaskCodegen, AudioTaskCodegen, MediaGenCodegen, QaRankingCodegen).

Renaming to HuggingFaceCodegenBase matches the sibling codegens and HuggingFaceInferenceOpDesc, making the scope obvious at a glance.

This is behavior-neutral: it does not change the generated Python (the emitted class is ProcessTableOperator; the object name never appears in output), serialized workflow JSON, or any public API.

Proposed change

All within the workflow-operator module, huggingFace package:

  • Rename codegen/PythonCodegenBase.scalacodegen/HuggingFaceCodegenBase.scala (object + file).
  • Rename codegen/PythonCodegenBaseSpec.scalacodegen/HuggingFaceCodegenBaseSpec.scala.
  • Update references in HuggingFaceInferenceOpDesc.scala (import, call site, doc comments), ImageTaskCodegen.scala, and TaskCodegen.scala (doc comments).

Required test

No new test needed, this is just a rename. Existing coverage confirms it's behavior-neutral: sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.*" passes, including PythonCodeRawInvalidTextSpec, which py-compiles every operator's generated Python.

Related

Review comment on PR #6972 (where this was flagged as a follow-up).

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions