Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Contributors:
* Josh Lynch (josh-lynch)
* Fabio (3ximus)
* Doug Harris (dougharris)
* Jay Knight (jay-knight)

Creator:
--------
Expand Down
5 changes: 5 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Internal:
* Update dev requirements and replace requirements-dev.txt with pyproject.toml
* Use ruff instead of black

Bug fixes:
----------

* Improve display of larger durations when passed as floats

4.3.0 (2025-03-22)
==================

Expand Down
4 changes: 2 additions & 2 deletions pgcli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1926,12 +1926,12 @@ def duration_in_words(duration_in_seconds: float) -> str:
components = []
hours, remainder = divmod(duration_in_seconds, 3600)
if hours > 1:
components.append(f"{hours} hours")
components.append(f"{int(hours)} hours")
elif hours == 1:
components.append("1 hour")
minutes, seconds = divmod(remainder, 60)
if minutes > 1:
components.append(f"{minutes} minutes")
components.append(f"{int(minutes)} minutes")
elif minutes == 1:
components.append("1 minute")
if seconds >= 2:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,11 @@ def test_application_name_db_uri(tmpdir):
(60, "1 minute"),
(61, "1 minute 1 second"),
(123, "2 minutes 3 seconds"),
(124.4, "2 minutes 4 seconds"),
(3600, "1 hour"),
(7235, "2 hours 35 seconds"),
(9005, "2 hours 30 minutes 5 seconds"),
(9006.7, "2 hours 30 minutes 6 seconds"),
(86401, "24 hours 1 second"),
],
)
Expand Down
Loading