Opened 12 months ago

Last modified 5 months ago

#22258 assigned New feature

Show progress during dumpdata and loaddata

Reported by: Gwildor Owned by: mrfuxi
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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 anubhav9042 11 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 11 months ago by anubhav9042

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.

comment:3 Changed 11 months ago by russellm

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 Changed 11 months ago by anubhav9042

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.

Changed 11 months ago by anubhav9042

comment:5 Changed 5 months ago by mrfuxi

  • Owner changed from nobody to mrfuxi
  • Status changed from new to assigned

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.

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