ChickenBenny commented on code in PR #76359:
URL: https://github.com/apache/airflow/pull/76359#discussion_r4549115579


##########
go-sdk/pkg/execution/execution_timeout.go:
##########
@@ -0,0 +1,49 @@
+// 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 execution
+
+import (
+       "context"
+       "fmt"
+
+       "github.com/apache/airflow/go-sdk/pkg/execution/genmodels"
+)
+
+// resolveExecutionTimeout returns the task's execution_timeout in seconds 
from ti_context, or nil
+// when it has none. The coordinator has already filled in the worker's 
default.
+func resolveExecutionTimeout(fromContext any) (*float64, error) {
+       if fromContext == nil {
+               return nil, nil
+       }
+       seconds, ok := ifaceFloat(fromContext)
+       if !ok {
+               return nil, fmt.Errorf(
+                       "ti_context.execution_timeout has unexpected wire shape 
%T",
+                       fromContext,
+               )
+       }
+       return &seconds, nil
+}

Review Comment:
   fix with 
https://github.com/apache/airflow/commit/dcec4a8b0fc01603d013df33a8b5c89998ac2ef7,The
 end-to-end tests already cover zero, unset, negative and a value that is not a 
number. They check the retry reason, not the log message, so they pass without 
changes.



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