uranusjr commented on code in PR #71536:
URL: https://github.com/apache/airflow/pull/71536#discussion_r3793799370
##########
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/task_arg_binding.py:
##########
@@ -37,7 +37,33 @@
"ArgValueSchema", Annotated[dict[str, JsonValue],
Field(title="ArgValueSchema")]
)
"""JSON-schema fragment constraining the value a stub-task argument binds to;
generated
-by pydantic from the stub annotation, carried verbatim, unknown keywords
ignored."""
+by pydantic from the stub annotation, carried verbatim, unknown keywords
ignored.
+
+``format`` carries the part of the contract ``type`` alone cannot: which
native type a
+lang SDK should decode the value into. Every SDK is expected to follow the
same table,
+so a Dag author sees one behaviour regardless of the task's language:
+
+=================== ========== ====================================
=========================
+Python annotation ``type`` ``format`` / wire spelling Native
target
+=================== ========== ====================================
=========================
+``datetime`` string ``date-time`` ``2024-01-02T03:04:05Z``
timestamp
+``date`` string ``date`` ``2024-01-02`` date
+``time`` string ``time`` ``03:04:05`` time
of day
+``timedelta`` string ``duration`` ``P1DT2H3M4S`` ``-PT1M30S``
duration
+``UUID`` string ``uuid`` ``6ba7b810-9dad-...-...`` UUID
+``bytes`` string ``binary`` (raw text, **not** base64) byte
string
Review Comment:
Are we sure this is correct? There’s no explicit bytes-handling, so this is
handled directly by Pydantic? Do we want to be explicit in the implementation
so we’re safe if Pydantic changes in the future?
--
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]