ofek/pypinfo

--where ignores project

dmtucker opened this issue · 1 comments

These match because --where 'file.project = "project"' gets silently overridden:

$ pypinfo --days 1095 --limit 36 --order download_month --where 'details.python = "1.17"' '' month
Served from cache: False
Data processed: 186.48 GiB
Data billed: 186.48 GiB
Estimated cost: $0.92

| download_month | download_count |
| -------------- | -------------- |
| 2018-03        |         18,667 |
| 2018-02        |         67,154 |
| 2018-01        |      1,898,377 |
| 2017-12        |         70,865 |
| 2017-11        |         64,577 |
| 2017-10        |         66,968 |
| 2017-09        |         63,809 |
| 2017-08        |         93,022 |
| 2017-07        |        628,639 |
| 2017-06        |        200,335 |
| 2017-05        |        148,618 |
| 2017-04        |         50,842 |
| 2017-03        |         53,755 |
| 2017-02        |         47,414 |
| 2017-01        |         50,651 |
| 2016-12        |         53,138 |
| 2016-11        |        129,537 |
| 2016-10        |        477,819 |
| 2016-09        |      1,013,797 |
| 2016-08        |        116,291 |
| 2016-07        |         81,521 |
| 2016-06        |         59,695 |
| 2016-05        |        151,872 |
| 2016-03        |          4,618 |
| 2016-02        |        226,267 |
| 2016-01        |        184,133 |
$ pypinfo --days 1095 --limit 36 --order download_month --where 'details.python = "1.17"' certifi month
Served from cache: True
Data processed: 0.00 B
Data billed: 0.00 B
Estimated cost: $0.00

| download_month | download_count |
| -------------- | -------------- |
| 2018-03        |         18,667 |
| 2018-02        |         67,154 |
| 2018-01        |      1,898,377 |
| 2017-12        |         70,865 |
| 2017-11        |         64,577 |
| 2017-10        |         66,968 |
| 2017-09        |         63,809 |
| 2017-08        |         93,022 |
| 2017-07        |        628,639 |
| 2017-06        |        200,335 |
| 2017-05        |        148,618 |
| 2017-04        |         50,842 |
| 2017-03        |         53,755 |
| 2017-02        |         47,414 |
| 2017-01        |         50,651 |
| 2016-12        |         53,138 |
| 2016-11        |        129,537 |
| 2016-10        |        477,819 |
| 2016-09        |      1,013,797 |
| 2016-08        |        116,291 |
| 2016-07        |         81,521 |
| 2016-06        |         59,695 |
| 2016-05        |        151,872 |
| 2016-03        |          4,618 |
| 2016-02        |        226,267 |
| 2016-01        |        184,133 |

This isn't a huge deal other than there isn't really a reason to even accept project in these cases.

Maybe it'd be better to tell people to run --where 'file.project = "project"' themselves or to work in an AND on custom --wheres:

$ pypinfo --days 1095 --limit 36 --order download_month --where 'details.python = "1.17" AND file.project = "certifi"' '' month
Served from cache: False
Data processed: 331.50 GiB
Data billed: 331.50 GiB
Estimated cost: $1.62

| download_month | download_count |
| -------------- | -------------- |
| 2018-03        |             70 |
| 2018-02        |             68 |
| 2018-01        |            155 |
| 2017-12        |             93 |
| 2017-11        |            116 |
| 2017-10        |             90 |
| 2017-09        |             95 |
| 2017-08        |             86 |
| 2017-07        |            112 |
| 2017-06        |             83 |
| 2017-05        |             69 |
| 2017-04        |             29 |
| 2017-03        |             12 |
| 2017-02        |             10 |
| 2017-01        |             13 |
| 2016-12        |              8 |
| 2016-11        |              8 |
| 2016-10        |             15 |
| 2016-09        |             55 |
| 2016-08        |             19 |
| 2016-07        |              3 |
| 2016-06        |             14 |
| 2016-05        |              3 |
| 2016-03        |              4 |
| 2016-02        |             13 |
| 2016-01        |              7 |

--order is affected by the same issue.

ofek commented

Thanks David, I will fix this soon!