airflow
airflow copied to clipboard
Fix a potential variable misuse bug
Hi,
This pull request is a fix to a potential variable misuse bug at airflow/models/dagrun.py
. Please check the changes.
Given the surrounding context, it seems to me that the correct variable should be ti
.
Best, Jingxuan
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst) Here are some useful points:
- Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
- In case of a new feature add useful documentation (in docstrings or in
docs/
directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it. - Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the Airflow Coding style. Apache Airflow is a community-driven project and together we are making it better 🚀. In case of doubts contact the developers at: Mailing List: [email protected] Slack: https://s.apache.org/airflow-slack
This bug was spotted by our automated tool statically. I am not familiar with the codebase so it would be difficult for me to add a test.
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.
Any news on this?
It seems like that part of the codebase will never be reached. It looks like a legacy code that needs cleaning. Doesn't seem to do anything
This is super ancient 8c42d03c4e35a0046e46f0e2e6db588702ee7e8b. The surrounding block seems reachable to me though? It essentially checks whether an existing task instance is still “relevant” i.e. the corresponding task is gone, and mark the ti as removed if needed.
This bug was spotted by our automated tool statically. I am not familiar with the codebase so it would be difficult for me to add a test.
Which tool was it out of interst?
This bug was spotted by our automated tool statically. I am not familiar with the codebase so it would be difficult for me to add a test.
Interesting, but I think without the automated false-positive detection and lack of reasoning leading to why it should be fixed it might be more noise than help.
Suggestion for furrher research in this area: Would be great if the tool also produced a likely "test" that tests the behaviour (and fails befiore and succeeds after). That would be a fantastic tool, as having tests whike reviewing is usually more productive than the code.
Interesting, but I think without the automated false-positive detection and lack of reasoning leading to why it should be fixed it might be more noise than help.
To be honest, during our manual inspection, we were also unsure if this case is a true bug or a false positive. But we made this PR so that we don't miss a possibly true bug, expecting someone who knows the codebase to correctly judge it. Other PRs we made to other repos (see the list at the end of the paper) were more clear and almost all of them were merged.
Suggestion for furrher research in this area: Would be great if the tool also produced a likely "test" that tests the behaviour (and fails befiore and succeeds after). That would be a fantastic tool, as having tests whike reviewing is usually more productive than the code.
Thanks for your suggestion! We will try to investigate on this.
Do you have any more reasoning/test case that we can add here @LostBenjamin ?
@potiuk
No.
Then I close it.