googleapis / googleapis/google-cloud-python

Request to improve the `tqdm` progress bar and output

Open
#15,511 3 comments 1 reaction 1 assignee Claimed by @jiaxunwu View on GitHub
api: bigquery type: feature request
Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
3d 4h
Merged PRs (30d)
122

Description

hi @aribray, looks like the issue is now solved! Thank you very much for that.

I only have one nitpick regarding the new progress bar setup: it's a bit weird to have two progress bars, and one of them is pushed to the right when the job ID appears:

![image](https://user-images.githubusercontent.com/5601876/200286260-fca6cba9-905b-4f8e-8ed5-46989d38f09f.png)

I suppose it would be better to have just a single progress bar on its own line (job ID should be its own line too).

If you want to make the output more complete, I've been also showing the data processed at the very end in my own bigquery magic like this:
```
from humanize.filesize import naturalsize
...
if args.info:
processed = naturalsize(query.total_bytes_processed)
display(ipywidgets.HTML(value='Data processed: ' + (
f'{processed}' if not query.cache_hit
else 'none (returned from cache)'
)))
```

With this addition the output looks like this:

![image](https://user-images.githubusercontent.com/5601876/200287992-5da8d1b9-511c-4fec-b7f2-297994cbb3ca.png)

It might look better if you add a colon after the "Job ID" too, but that's just my subjective preference.

_Originally posted by @GergelyKalmar in https://github.com/googleapis/python-bigquery/issues/1146#issuecomment-1305399150_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.