You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/22 17:02:13 UTC
[GitHub] [airflow] aschoe21 opened a new pull request, #23173: Fix Task Duration Calculation & Display
aschoe21 opened a new pull request, #23173:
URL: https://github.com/apache/airflow/pull/23173
closes: #23169
Prevent moment from truncating the result of diff to zero decimal places
As moment.diff has the default behavior of truncating the decimal places of diff results (i.e. rounding down to the nearest integer), when the duration of a task run is less than a full second moment rounds the duration down to 0. This behavior results in the task duration rendering as empty/null rather than as the correct task run duration.
Moment's diff function accepts a third, optional boolean argument that dictates its result truncation behavior. By default this value is false which leads to the unwanted behavior described above. Setting this argument to true when calling diff will allow the result to exist as a decimal, fixing the situation where task run duration is rounded down to 0 seconds.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1181158972
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] closed pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #23173: Fix Task Duration Calculation & Display
URL: https://github.com/apache/airflow/pull/23173
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] bbovenzi commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
bbovenzi commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1108539378
> Would the decimal places always show, even when the duration is long? Ideally I’d only want them when the duration is <1 and not if it’s e.g. 105.378 seconds.
Yes, and this also breaks down when duration is better shown as minutes, hours or even days. Overall, how we display durations in the UI is inconsistent and we should consolidate down to one format. I was playing around with that here: https://github.com/apache/airflow/pull/22996/files
What do you think of choosing the most important unit and then limiting to just 2 decimal places:
<img width="78" alt="Screen Shot 2022-04-25 at 8 59 59 AM" src="https://user-images.githubusercontent.com/4600967/165094270-c0935f9c-9913-4f36-a4d0-cb052e903f1b.png">
<img width="72" alt="Screen Shot 2022-04-25 at 8 59 55 AM" src="https://user-images.githubusercontent.com/4600967/165094272-83383e90-1c60-421b-960f-27d8afae05d3.png">
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1106699312
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]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) 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](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) 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](https://www.apache.org/foundation/policies/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]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] frankcash commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
frankcash commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1106733790
hi @aschoe21 could you include a screenshot of the functionality working as well?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] ashb commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
ashb commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1108762948
I think if it's in to minutes or hours then `1h58m` is better `1.98h`
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
uranusjr commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1108068854
Would the decimal places always show, even when the duration is long? Ideally I’d only want them when the duration is <1 and not if it’s e.g. 105.378 seconds.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] eladkal commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
eladkal commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1139273282
@aschoe21 are you still working on this PR?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] aschoe21 commented on pull request #23173: Fix Task Duration Calculation & Display
Posted by GitBox <gi...@apache.org>.
aschoe21 commented on PR #23173:
URL: https://github.com/apache/airflow/pull/23173#issuecomment-1106778037
> hi @aschoe21 could you include a screenshot of the functionality working as well?
Sure, here's a screenshot of the tooltip showing a task completing in 0.105Sec

--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org