You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2026/07/02 06:12:24 UTC
Re: [PR] Add Dag run context fields to the Java SDK Context [airflow]
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org