Ma77Ball commented on code in PR #5300:
URL: https://github.com/apache/texera/pull/5300#discussion_r3330944923
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionsMetadataPersistService.scala:
##########
@@ -46,25 +46,27 @@ object ExecutionsMetadataPersistService extends LazyLogging
{
* This method inserts a new entry of a workflow execution in the database
and returns the generated eId
*
* @param workflowId the given workflow
- * @param uid user id that initiated the execution
+ * @param uid user id that initiated the execution; must be non-null
(uid is NOT NULL)
* @return generated execution ID
*/
def insertNewExecution(
workflowId: WorkflowIdentity,
- uid: Option[Integer],
+ uid: Integer,
executionName: String,
environmentVersion: String,
computingUnitId: Integer
): ExecutionIdentity = {
+ // uid is NOT NULL; reject up front instead of a cryptic jOOQ violation.
+ require(uid != null, "uid must be provided to persist a new workflow
execution")
Review Comment:
Kept `Option[Integer]` and dropped the `require`/null path. `setUid` now
does `uid.getOrElse(throw new IllegalArgumentException(...))`, so a `None`
raises instead of writing null.
##########
amber/src/main/scala/org/apache/texera/web/service/WorkflowService.scala:
##########
@@ -204,7 +204,7 @@ class WorkflowService(
workflowContext.executionId =
ExecutionsMetadataPersistService.insertNewExecution(
workflowContext.workflowId,
- uidOpt,
+ uidOpt.orNull,
Review Comment:
Dropped `.orNull` here. The caller now passes the `Option` through
unchanged, and the service raises on `None`.
--
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]