uranusjr commented on code in PR #69100:
URL: https://github.com/apache/airflow/pull/69100#discussion_r3510848418


##########
java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/Context.kt:
##########
@@ -63,9 +81,31 @@ data class Context(
   @JvmField val ti: TaskInstance,
 ) {
   internal companion object {
+    private fun toDateTime(value: Any?): OffsetDateTime? =
+      when (value) {
+        is OffsetDateTime -> value
+        is String -> runCatching { OffsetDateTime.parse(value) }.getOrNull()
+        else -> null

Review Comment:
   Probably a good idea to emit a waarning if parsing failed or an unrecognized 
value is received. Not really possible (unless we broke the supervisor comms 
interface), but it’s be very helpful if things do go wrong.



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