Skip to content

Conversation

@Taragolis
Copy link
Contributor

Change task_instance.priority_weight type from int to float

Alternatives:


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of overflow int32 (MySQL/Postgres) and presumably int64 in SQLite it will raise an error

Example of Postgres error

  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.DataError: (psycopg2.errors.NumericValueOutOfRange) integer out of range

[SQL: ALTER TABLE task_instance ALTER COLUMN priority_weight TYPE INTEGER ]
(Background on this error at: https://sqlalche.me/e/14/9h9h)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can prevent that easily - and I'd say it's an edge case of an edge-case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check on backend before save it into the DB 🤣

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That indeed looks much simpler :)

@Taragolis Taragolis added the full tests needed We need to run full set of tests for this PR to merge label Mar 14, 2024
@Taragolis Taragolis force-pushed the change-prioriry-weight-type branch from 851d677 to da97cfb Compare March 14, 2024 19:21
@Taragolis
Copy link
Contributor Author

That indeed looks much simpler :)

I have an opposite opinion about it

@Taragolis
Copy link
Contributor Author

Closed it should be implemented in top of the #38222
In addition changing type of weighted sum affects different parts, include executors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants