-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in previous-successful-dagrun
Execution API endpoint
#48520
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This should close #47612 which is the relevant bug report |
ashb
approved these changes
Mar 29, 2025
2 tasks
5b030a1
to
cc56217
Compare
The bug was as mentioned in apache#48503 where the `logical_date` of the currrent TI was None. We should return an empty `PrevSuccessfulDagRunResponse()` but because we weren't checking for it, the API server failed with: ``` airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1160: in test_ti_with_none_as_logical_date response = client.get(f"/execution/task-instances/{ti.id}/previous-successful-dagrun") /usr/local/lib/python3.10/site-packages/starlette/testclient.py:465: in get return super().get( ... ... /usr/local/lib/python3.10/site-packages/cadwyn/schema_generation.py:504: in __call__ return self._original_callable(*args, **kwargs) airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:555: in get_previous_successful_dagrun DR.logical_date < task_instance.logical_date, /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:322: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/properties.py:426: in operate return op(self.__clause_element__(), *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py:873: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:1379: in operate return super(TypeDecorator.Comparator, self).operate( /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:77: in operate return o[0](self.expr, op, *(other + o[1:]), **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/default_comparator.py:95: in _boolean_compare raise exc.ArgumentError( E sqlalchemy.exc.ArgumentError: Only '=', '!=', 'is_()', 'is_not()', 'is_distinct_from()', 'is_not_distinct_from()' operators can be used with None/True/False ```
cc56217
to
b009f16
Compare
shubham-pyc
pushed a commit
to shubham-pyc/airflow
that referenced
this pull request
Apr 2, 2025
…e#48520) The bug was as mentioned in apache#48503 where the `logical_date` of the currrent TI was None. We should return an empty `PrevSuccessfulDagRunResponse()` but because we weren't checking for it, the API server failed with: ``` airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1160: in test_ti_with_none_as_logical_date response = client.get(f"/execution/task-instances/{ti.id}/previous-successful-dagrun") /usr/local/lib/python3.10/site-packages/starlette/testclient.py:465: in get return super().get( ... ... /usr/local/lib/python3.10/site-packages/cadwyn/schema_generation.py:504: in __call__ return self._original_callable(*args, **kwargs) airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:555: in get_previous_successful_dagrun DR.logical_date < task_instance.logical_date, /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:322: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/properties.py:426: in operate return op(self.__clause_element__(), *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py:873: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:1379: in operate return super(TypeDecorator.Comparator, self).operate( /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:77: in operate return o[0](self.expr, op, *(other + o[1:]), **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/default_comparator.py:95: in _boolean_compare raise exc.ArgumentError( E sqlalchemy.exc.ArgumentError: Only '=', '!=', 'is_()', 'is_not()', 'is_distinct_from()', 'is_not_distinct_from()' operators can be used with None/True/False ```
nailo2c
pushed a commit
to nailo2c/airflow
that referenced
this pull request
Apr 4, 2025
…e#48520) The bug was as mentioned in apache#48503 where the `logical_date` of the currrent TI was None. We should return an empty `PrevSuccessfulDagRunResponse()` but because we weren't checking for it, the API server failed with: ``` airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1160: in test_ti_with_none_as_logical_date response = client.get(f"/execution/task-instances/{ti.id}/previous-successful-dagrun") /usr/local/lib/python3.10/site-packages/starlette/testclient.py:465: in get return super().get( ... ... /usr/local/lib/python3.10/site-packages/cadwyn/schema_generation.py:504: in __call__ return self._original_callable(*args, **kwargs) airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:555: in get_previous_successful_dagrun DR.logical_date < task_instance.logical_date, /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:322: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/properties.py:426: in operate return op(self.__clause_element__(), *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py:873: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:1379: in operate return super(TypeDecorator.Comparator, self).operate( /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:77: in operate return o[0](self.expr, op, *(other + o[1:]), **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/default_comparator.py:95: in _boolean_compare raise exc.ArgumentError( E sqlalchemy.exc.ArgumentError: Only '=', '!=', 'is_()', 'is_not()', 'is_distinct_from()', 'is_not_distinct_from()' operators can be used with None/True/False ```
simonprydden
pushed a commit
to simonprydden/airflow
that referenced
this pull request
Apr 8, 2025
…e#48520) The bug was as mentioned in apache#48503 where the `logical_date` of the currrent TI was None. We should return an empty `PrevSuccessfulDagRunResponse()` but because we weren't checking for it, the API server failed with: ``` airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1160: in test_ti_with_none_as_logical_date response = client.get(f"/execution/task-instances/{ti.id}/previous-successful-dagrun") /usr/local/lib/python3.10/site-packages/starlette/testclient.py:465: in get return super().get( ... ... /usr/local/lib/python3.10/site-packages/cadwyn/schema_generation.py:504: in __call__ return self._original_callable(*args, **kwargs) airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:555: in get_previous_successful_dagrun DR.logical_date < task_instance.logical_date, /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:322: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/orm/properties.py:426: in operate return op(self.__clause_element__(), *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py:873: in operate return op(self.comparator, *other, **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/operators.py:368: in __lt__ return self.operate(lt, other) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:1379: in operate return super(TypeDecorator.Comparator, self).operate( /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/type_api.py:77: in operate return o[0](self.expr, op, *(other + o[1:]), **kwargs) /usr/local/lib/python3.10/site-packages/sqlalchemy/sql/default_comparator.py:95: in _boolean_compare raise exc.ArgumentError( E sqlalchemy.exc.ArgumentError: Only '=', '!=', 'is_()', 'is_not()', 'is_distinct_from()', 'is_not_distinct_from()' operators can be used with None/True/False ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #47612
The bug was as mentioned in #48503 where the
logical_date
of the currrent TI was None.We should return an empty
PrevSuccessfulDagRunResponse()
but because we weren't checking for it, the API server failed with:^ 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 airflow-core/newsfragments.