dhkim1920 opened a new issue, #77079:
URL: https://github.com/apache/airflow/issues/77079

   ### Problem
   
   Follow-up to #73783, requested in [this review 
comment](https://github.com/apache/airflow/pull/73783#discussion_r4547275240).
   
   With MySQL, large integer values in `DagRun.conf` can be returned as Python 
floats after a JSON database round trip. The original integer type is lost, and 
values that cannot be represented exactly as a float can also lose numeric 
precision. This happens before the Task SDK's MessagePack serialization.
   
   The absence of a MessagePack overflow on this backend therefore does not 
establish correct behavior: a task can receive a silently changed value.
   
   ### Reproduction
   
   Using Airflow 3 workspace sources with a MySQL metadata database:
   
   1. Store a Dag run conf containing `{"large_integer": -9223372036854775809}` 
(below signed int64), and separately `{"large_integer": 18446744073709551616}` 
(above unsigned int64).
   2. Commit, expire the SQLAlchemy session state, and reload `DagRun.conf`.
   3. Compare both the numeric value and Python type with the original input, 
then inspect the task-start Execution API response.
   
   The integration test `TestTIRunState.test_run_returns_large_integer_conf` in 
`airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py`
 covers this path. Its two out-of-range cases currently exclude MySQL. 
Native-range boundary values and the numeric string case still run on MySQL.
   
   Not every conversion to float necessarily changes the numeric value; 
`2**64`, for example, is exactly representable as a binary float. The negative 
case also exercises precision loss.
   
   ### Expected behavior and follow-up
   
   Airflow should guard against silently changing integer values during MySQL 
JSON persistence. Determine whether to preserve these values exactly or reject 
unsupported values with a clear error before persistence.
   
   - Add MySQL regression coverage for nested conf values below signed int64 
and above unsigned int64, including a positive value such as `2**64 + 1` that 
exposes precision loss.
   - Verify values after a database reload and through the Execution API.
   - Preserve support for native-range integers and numeric strings.
   - Replace the MySQL exclusions in #73783 with assertions for the agreed 
behavior once implemented.
   
   This issue tracks the persistence/validation work separately from #73783's 
large-integer transport fix. It does not prescribe preserving Python 
float-versus-int identity for all JSON numbers.
   
   ---
   Drafted-by: Codex (GPT-6) (no human review before posting)
   
   


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