You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use humanize() to print out human (engineer)-readable durations for a potentially long-running data processing pipeline I'm working on.
For my pipeline, the useful precision for duration output depends on how long a given run takes to execute, and can span seconds to hours. I'd settled on seconds as a useful metric for logging approximate runtime, but humanize() doesn't seem to be giving me the expected output when I add the granularity argument.
I'd expected the final statement to ideally evaluate to "3 minutes 20 seconds", or at least to "200 seconds". If "granularity" is intended to convey a seconds remainder, e.g. in this case of "3 minutes 20 seconds" the output should still be "20 seconds". It's also worth noting that I thought the documentation on the granularity argument could use some fleshing out to disambiguate cases like i've mentioned here.
System Info
🖥 OS name and version: alpine3.9
🐍 Python version: Python 3.7.3 -->
🏹 Arrow version: 0.15.4
The text was updated successfully, but these errors were encountered:
Hey @chimaerase we have a PR open right now (#722) which should solve the "3 minutes 20 seconds" part of your question.
As to the first part of your post it's definitely a possible bug in humanize, or at the very least surprising behavior. I think it wasn't designed for precision (anything from 10 to 44 seconds returns seconds ago) when granularity is auto. From the looks of it granularity = "second" needs to be altered to allow greater precision.
jadchaar
changed the title
humanize() granularity doesn't behave as expected
humanize granularity doesn't behave as expected
Dec 9, 2019
Issue Description
I'd like to use humanize() to print out human (engineer)-readable durations for a potentially long-running data processing pipeline I'm working on.
For my pipeline, the useful precision for duration output depends on how long a given run takes to execute, and can span seconds to hours. I'd settled on seconds as a useful metric for logging approximate runtime, but humanize() doesn't seem to be giving me the expected output when I add the granularity argument.
I'd expected the final statement to ideally evaluate to "3 minutes 20 seconds", or at least to "200 seconds". If "granularity" is intended to convey a seconds remainder, e.g. in this case of "3 minutes 20 seconds" the output should still be "20 seconds". It's also worth noting that I thought the documentation on the granularity argument could use some fleshing out to disambiguate cases like i've mentioned here.
System Info
The text was updated successfully, but these errors were encountered: