Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
github-actions[bot] closed pull request #44687: Add foreign key ti_id in `TaskReschedule` and other models URL: https://github.com/apache/airflow/pull/44687 -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
github-actions[bot] commented on PR #44687: URL: https://github.com/apache/airflow/pull/44687#issuecomment-2632467008 This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
SuccessMoses commented on PR #44687: URL: https://github.com/apache/airflow/pull/44687#issuecomment-2556981462 @potiuk, is it a good idea to remove `task_id`, `run_id`, `dag_id` and `map_index` ? -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
SuccessMoses commented on code in PR #44687: URL: https://github.com/apache/airflow/pull/44687#discussion_r1875990926 ## airflow/models/taskinstance.py: ## @@ -1634,6 +1634,7 @@ def _handle_reschedule( # see https://github.com/apache/airflow/pull/21362 for more info session.add( TaskReschedule( +ti.ti_id, ti.task_id, ti.dag_id, ti.run_id, Review Comment: The new `ti_id` makes old PK columns to be redundant. You can obtain `dag_id` and `run_id` by using `join` statement -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
SuccessMoses commented on code in PR #44687: URL: https://github.com/apache/airflow/pull/44687#discussion_r1875990926 ## airflow/models/taskinstance.py: ## @@ -1634,6 +1634,7 @@ def _handle_reschedule( # see https://github.com/apache/airflow/pull/21362 for more info session.add( TaskReschedule( +ti.ti_id, ti.task_id, ti.dag_id, ti.run_id, Review Comment: The new `ti_id` makes old PK columns to be redundant. You can obtain `dag_id` and `run_id` by using `join` statement -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
SuccessMoses commented on code in PR #44687: URL: https://github.com/apache/airflow/pull/44687#discussion_r1875990926 ## airflow/models/taskinstance.py: ## @@ -1634,6 +1634,7 @@ def _handle_reschedule( # see https://github.com/apache/airflow/pull/21362 for more info session.add( TaskReschedule( +ti.ti_id, ti.task_id, ti.dag_id, ti.run_id, Review Comment: The new `ti_id` makes old PK columns to be redundant. -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
ashb commented on code in PR #44687: URL: https://github.com/apache/airflow/pull/44687#discussion_r1875063655 ## airflow/models/taskinstance.py: ## @@ -1634,6 +1634,7 @@ def _handle_reschedule( # see https://github.com/apache/airflow/pull/21362 for more info session.add( TaskReschedule( +ti.ti_id, ti.task_id, ti.dag_id, ti.run_id, Review Comment: We should think if we need the old PK columns or if just id is enough. (I'm not sure either way but we should think about it) -- 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]
Re: [PR] Add foreign key ti_id in `TaskReschedule` and other models [airflow]
ashb commented on code in PR #44687: URL: https://github.com/apache/airflow/pull/44687#discussion_r1875063334 ## airflow/models/renderedtifields.py: ## @@ -95,6 +97,12 @@ class RenderedTaskInstanceFields(TaskInstanceDependencies): name="rtif_ti_fkey", Review Comment: This key is "wrong" now as the pk for ti is it's UUID `id` column ## airflow/models/renderedtifields.py: ## @@ -95,6 +97,12 @@ class RenderedTaskInstanceFields(TaskInstanceDependencies): name="rtif_ti_fkey", ondelete="CASCADE", ), +ForeignKeyConstraint( +[dag_id, run_id], +["dag_run.dag_id", "dag_run.run_id"], +name="rtif_ti_fkey2", Review Comment: This key isn't to ti - it's to dagrun ## airflow/models/renderedtifields.py: ## @@ -69,6 +70,7 @@ class RenderedTaskInstanceFields(TaskInstanceDependencies): __tablename__ = "rendered_task_instance_fields" +ti_id = Column(postgresql.UUID(as_uuid=True), nullable=False) Review Comment: This shouldn't be a db specific type -- 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]
