Skip to content

Get rid of Python2 numeric relics#33050

Merged
potiuk merged 2 commits into
apache:mainfrom
eumiro:integers
Aug 3, 2023
Merged

Get rid of Python2 numeric relics#33050
potiuk merged 2 commits into
apache:mainfrom
eumiro:integers

Conversation

@eumiro

@eumiro eumiro commented Aug 2, 2023

Copy link
Copy Markdown
Contributor

Migration from Python2 to Python3 changes some numeric behavior. In Python3:

  • round(), math.ceil() and math.floor() return int instead of float
  • true division int / int returns float and therefore it is not necessary to convert one of the parts to float or to multiply the expression by 1.0

The code has been simplified. No functionality has been changed.

@boring-cyborg

boring-cyborg Bot commented Aug 2, 2023

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder why the outer floor existed in the first place. That wouldn’t do anything on Python 2 either…

Comment thread tests/test_utils/perf/perf_kit/repeat_and_time.py Outdated
@potiuk
potiuk merged commit e3d82c6 into apache:main Aug 3, 2023
@boring-cyborg

boring-cyborg Bot commented Aug 3, 2023

Copy link
Copy Markdown

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

@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Aug 4, 2023
ephraimbuddy pushed a commit that referenced this pull request Aug 4, 2023
@eumiro
eumiro deleted the integers branch August 5, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:providers area:webserver Webserver related Issues provider:celery provider:common-sql provider:docker provider:google Google (including GCP) related issues type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants