Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#22258 closed New feature (fixed)

Show progress during dumpdata

Reported by: Gwildor Sok Owned by: Karol Duleba
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In response of ticket #22251, I'm opening this as a separate issue like requested. You can read the need for this option there, but shortly speaking, the commands as they are now are not user friendly at all. The commands can go on for a very long time, depending on your database size, without giving any clue of its state and progress.

If and when #22257 is implemented, the commands could start by collecting amount of rows to progress, and periodically printing the progress to the console. This way the user can make a fair estimate on when the commands are done and whether they are actually still running.

Attachments (1)

22258#test.diff (1.2 KB ) - added by ANUBHAV JOSHI 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Aymeric Augustin, 10 years ago

Triage Stage: UnreviewedAccepted

comment:2 by ANUBHAV JOSHI, 10 years ago

We can add the patch given #22257, then as posted there:
I think we can keep default as stdout and and for this, we can do the following:

  • When -o is not used, let the data be printed to stdout, as the data is printing people can see it and I don't think any progress display is required there.
  • When -o will be used, then we can display progress percentage or something like that.

backwards compatibilty is there, also issue here is also addressed.
thoughts?

comment:3 by Russell Keith-Magee, 10 years ago

Before we get too carried away here, someone needs to explain how it's going to be implemented. json.dumps and lxml don't provide progress APIs AFAIK.

comment:4 by ANUBHAV JOSHI, 10 years ago

Well I am attaching a simple diff just for JSON. It does very simply does the job of displaying progress(random not actual), but we can think along similar lines like we could calculate total no. of objects and then print progress accurately depending upon no of objects serialized.

by ANUBHAV JOSHI, 10 years ago

Attachment: 22258#test.diff added

comment:5 by Karol Duleba, 10 years ago

Owner: changed from nobody to Karol Duleba
Status: newassigned

I was thinking of adding some kind of utility to allow showing progress from any management command.

As far as I looked (loading data) there is no clean way of showing % of progress because of generators/reading streams from files, so progress like during tests. For data load it might be possible to show proper progress bar.

comment:6 by Claude Paroz, 9 years ago

Has patch: set
Needs tests: set

188a2418807f661eedfc675731521f2f46a3c49a (#21652) added progress information for loaddata.

This PR is adding progress report for dumpdata: https://github.com/django/django/pull/5032

comment:7 by Claude Paroz, 9 years ago

Needs tests: unset

comment:8 by Tim Graham, 9 years ago

Summary: Show progress during dumpdata and loaddataShow progress during dumpdata
Triage Stage: AcceptedReady for checkin

comment:9 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In c296e55:

Fixed #22258 -- Added progress status for dumpdata when outputting to file

Thanks Gwildor Sok for the report and Tim Graham for the review.

comment:10 by Tim Graham <timograham@…>, 9 years ago

In eaa3c88:

Refs #22258 -- Fixed an unclosed temporary file in fixtures test.

This prevented the temporary directory from being removed
on Windows.

Note: See TracTickets for help on using tickets.
Back to Top