kaxil commented on code in PR #67388:
URL: https://github.com/apache/airflow/pull/67388#discussion_r3294276889
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -953,9 +955,9 @@ def _executable_task_instances_to_queued(self, max_tis:
int, session: Session) -
opt_in_names.add(exc.name.module_path)
whens = []
if opt_in_names:
Review Comment:
Is it worth baking the cast into `random_db_uuid` itself instead of wrapping
every call site? In `airflow-core/src/airflow/utils/sqlalchemy.py`:
```python
@compiles(random_db_uuid, "postgresql")
def _random_db_uuid_pg(element, compiler, **kw):
return "gen_random_uuid()::text"
```
That makes the function safe in any expression context (CASE, UNION, CTE,
INSERT...SELECT, RETURNING) without each caller having to remember
`sql_cast(..., Text)`. The unconditional path at L944 only works today because
PG has an implicit *assignment* cast (`SET text_col = uuid_expr`); a future
call site in a stricter context would hit the same `DatatypeMismatch` and not
be obvious why.
Not blocking!
--
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]