Skip to content

Commit

Permalink
Move from humanize to pendulum library for displaying query durations (
Browse files Browse the repository at this point in the history
  • Loading branch information
tomplex authored Jul 29, 2020
1 parent 80bf05a commit 8f7e314
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Contributors:
* Igor Kim (igorkim)
* Anthony DeBarros (anthonydb)
* Seungyong Kwak (GUIEEN)
* Tom Caruso (tomplex)

Creator:
--------
Expand Down
1 change: 1 addition & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bug fixes:

* Minor typo fixes in `pgclirc`. (Thanks: `anthonydb`_)
* Fix for list index out of range when executing commands from a file (#1193). (Thanks: `Irina Truong`_)
* Move from `humanize` to `pendulum` for displaying query durations (#1015)

3.0.0
=====
Expand Down
6 changes: 3 additions & 3 deletions pgcli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import threading
import shutil
import functools
import humanize
import pendulum
import datetime as dt
import itertools
import platform
Expand Down Expand Up @@ -692,9 +692,9 @@ def execute_command(self, text):
"Time: %0.03fs (%s), executed in: %0.03fs (%s)"
% (
query.total_time,
humanize.time.naturaldelta(query.total_time),
pendulum.Duration(seconds=query.total_time).in_words(),
query.execution_time,
humanize.time.naturaldelta(query.execution_time),
pendulum.Duration(seconds=query.execution_time).in_words(),
)
)
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"psycopg2 >= 2.8",
"sqlparse >=0.3.0,<0.4",
"configobj >= 5.0.6",
"humanize >= 0.5.1",
"pendulum>=2.1.0",
"cli_helpers[styles] >= 2.0.0",
]

Expand Down

0 comments on commit 8f7e314

Please sign in to comment.