Skip to content
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

Adding Code Coverage webserver code and Fix TypeError and AttributeError in Views.py #40254

Merged
merged 33 commits into from
Jul 24, 2024

Conversation

andyjianzhou
Copy link
Contributor

@andyjianzhou andyjianzhou commented Jun 15, 2024

Improved code coverage in these following spaces in both Webserver and Core:

Run: Core: python scripts/cov/core_coverage.py
Run: Webserver: python scripts/cov/www_coverage.py

airflow/models/taskmap.py - Increased from 82% to 100% Coverage
airflow/www/widgets.py - Increased from 79% to 100% Coverage
airflow/www/views.py - Help increase Coverage from 78% to 85%
Related: #35127


^ 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.

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Jun 15, 2024
Copy link

boring-cyborg bot commented Jun 15, 2024

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, 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.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    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

@andyjianzhou andyjianzhou marked this pull request as draft June 15, 2024 05:43
@andyjianzhou andyjianzhou changed the title Andy/unittest coverage issue Adding Code Coverage webserver code and Fix TypeError and AttributeError in get_date_time_num_runs_dag_runs_form_data function Jun 15, 2024
@andyjianzhou andyjianzhou changed the title Adding Code Coverage webserver code and Fix TypeError and AttributeError in get_date_time_num_runs_dag_runs_form_data function Adding Code Coverage webserver code and Fix TypeError and AttributeError in Views.py Jun 15, 2024
airflow/www/views.py Outdated Show resolved Hide resolved
tests/www/test_validators.py Outdated Show resolved Hide resolved
tests/www/views/test_views_grid.py Outdated Show resolved Hide resolved
@uranusjr
Copy link
Member

You’ll need to revert the whitespace changes, they cause the linter to fail.

@andyjianzhou
Copy link
Contributor Author

You’ll need to revert the whitespace changes, they cause the linter to fail.

Will do thanks!

@andyjianzhou andyjianzhou marked this pull request as ready for review June 20, 2024 18:08
@eladkal eladkal modified the milestone: Airflow 2.9.3 Jun 28, 2024
@eladkal eladkal added changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) labels Jun 28, 2024
@RNHTTR RNHTTR requested review from aritra24 and uranusjr July 19, 2024 15:47
Copy link
Collaborator

@aritra24 aritra24 left a comment

Choose a reason for hiding this comment

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

Looks fine to me, a few nits and questions

tests/www/views/test_views_tasks.py Show resolved Hide resolved
tests/models/test_xcom_arg_map.py Show resolved Hide resolved
@RNHTTR
Copy link
Contributor

RNHTTR commented Jul 22, 2024

@potiuk a test that seems to be completely unrelated to these changes is failing. Any recommendation here?

@potiuk
Copy link
Member

potiuk commented Jul 23, 2024

@potiuk a test that seems to be completely unrelated to these changes is failing. Any recommendation here?

I re-run it (next time you can do it as well -> top-right re-run button with "re-run failed tests` dropdown.. Mssql server on linux has a tenedency to suddenly stop working and takes a lot of memory (one of the reasons we dumped mssql as backend as it was making our tests way flakier that they should be.

@bbovenzi bbovenzi merged commit 1fdf887 into apache:main Jul 24, 2024
48 checks passed
Copy link

boring-cyborg bot commented Jul 24, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants