Products grid inconsistent when filtered by "Vendor (any)" #2
Open
opened 2025-02-16 13:31:25 -06:00 by lance
·
1 comment
No Branch/Tag specified
master
custorders
v0.4
v0.22.7
v0.22.6
v0.22.5
v0.22.4
v0.22.3
v0.22.2
v0.22.1
v0.22.0
v0.21.11
v0.21.10
v0.21.9
v0.21.8
v0.21.7
v0.21.6
v0.21.5
v0.21.4
v0.21.3
v0.21.2
v0.21.1
v0.21.0
v0.20.1
v0.20.0
v0.19.3
v0.19.2
v0.19.1
v0.19.0
v0.18.0
v0.17.0
v0.16.1
v0.16.0
v0.15.6
v0.15.5
v0.15.4
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.5
v0.14.4
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.2
v0.13.1
v0.13.0
v0.12.1
v0.12.0
v0.11.10
v0.11.9
v0.11.8
v0.11.7
v0.11.6
v0.11.5
v0.11.4
v0.11.3
v0.11.2
v0.11.1
v0.11.0
v0.10.16
v0.10.15
v0.10.14
v0.10.13
v0.10.12
v0.10.11
v0.10.10
v0.10.9
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.96
v0.9.95
v0.9.94
v0.9.93
v0.9.92
v0.9.91
v0.9.90
v0.9.89
v0.9.88
v0.9.87
v0.9.86
v0.9.85
v0.9.84
v0.9.83
v0.9.82
v0.9.81
v0.9.80
v0.9.79
v0.9.78
v0.9.77
v0.9.76
v0.9.75
v0.9.74
v0.9.73
v0.9.72
v0.9.71
v0.9.70
v0.9.69
v0.9.68
v0.9.67
v0.9.66
v0.9.65
v0.9.64
v0.9.63
v0.9.62
v0.9.61
v0.9.60
v0.9.59
v0.9.58
v0.9.57
v0.9.56
v0.9.55
v0.9.54
v0.9.53
v0.9.52
v0.9.51
v0.9.50
v0.9.49
v0.9.48
v0.9.47
v0.9.46
v0.9.45
v0.9.44
v0.9.43
v0.9.42
v0.9.41
v0.9.40
v0.9.39
v0.9.38
v0.9.37
v0.9.36
v0.9.35
v0.9.34
v0.9.33
v0.9.32
v0.9.31
v0.9.30
v0.9.29
v0.9.28
v0.9.27
v0.9.26
v0.9.25
v0.9.24
v0.9.23
v0.9.22
v0.9.21
v0.9.20
v0.9.19
v0.9.18
v0.9.17
v0.9.16
v0.9.15
v0.9.14
v0.9.13
v0.9.12
v0.9.11
v0.9.10
v0.9.9
v0.9.8
v0.9.7
v0.9.6
v0.9.5
v0.9.4
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.292
v0.8.291
v0.8.290
v0.8.289
v0.8.288
v0.8.287
v0.8.286
v0.8.285
v0.8.284
v0.8.283
v0.8.282
v0.8.281
v0.8.280
v0.8.279
v0.8.278
v0.8.277
v0.8.276
v0.8.275
v0.8.274
v0.8.273
v0.8.272
v0.8.271
v0.8.270
v0.8.269
v0.8.268
v0.8.267
v0.8.266
v0.8.265
v0.8.264
v0.8.263
v0.8.262
v0.8.261
v0.8.260
v0.8.259
v0.8.258
v0.8.257
v0.8.256
v0.8.255
v0.8.254
v0.8.253
v0.8.252
v0.8.251
v0.8.250
v0.8.249
v0.8.248
v0.8.247
v0.8.246
v0.8.245
v0.8.244
v0.8.243
v0.8.242
v0.8.241
v0.8.240
v0.8.239
v0.8.238
v0.8.237
v0.8.236
v0.8.235
v0.8.234
v0.8.233
v0.8.232
v0.8.231
v0.8.230
v0.8.229
v0.8.228
v0.8.227
v0.8.226
v0.8.225
v0.8.224
v0.8.223
v0.8.222
v0.8.221
v0.8.220
v0.8.219
v0.8.218
v0.8.217
v0.8.216
v0.8.215
v0.8.214
v0.8.213
v0.8.212
v0.8.211
v0.8.210
v0.8.209
v0.8.208
v0.8.207
v0.8.206
v0.8.205
v0.8.204
v0.8.203
v0.8.202
v0.8.201
v0.8.200
v0.8.199
v0.8.198
v0.8.197
v0.8.196
v0.8.195
v0.8.194
v0.8.193
v0.8.192
v0.8.191
v0.8.190
v0.8.189
v0.8.188
v0.8.187
v0.8.186
v0.8.185
v0.8.184
v0.8.183
v0.8.182
v0.8.181
v0.8.180
v0.8.179
v0.8.178
v0.8.177
v0.8.176
v0.8.175
v0.8.174
v0.8.173
v0.8.172
v0.8.171
v0.8.170
v0.8.169
v0.8.168
v0.8.167
v0.8.166
v0.8.165
v0.8.164
v0.8.163
v0.8.162
v0.8.161
v0.8.160
v0.8.159
v0.8.158
v0.8.157
v0.8.156
v0.8.155
v0.8.154
v0.8.153
v0.8.152
v0.8.151
v0.8.150
v0.8.149
v0.8.148
v0.8.147
v0.8.146
v0.8.145
v0.8.144
v0.8.143
v0.8.142
v0.8.141
v0.8.140
v0.8.139
v0.8.138
v0.8.137
v0.8.136
v0.8.135
v0.8.134
v0.8.133
v0.8.132
v0.8.131
v0.8.130
v0.8.129
v0.8.128
v0.8.127
v0.8.126
v0.8.125
v0.8.124
v0.8.123
v0.8.122
v0.8.121
v0.8.120
v0.8.119
v0.8.118
v0.8.117
v0.8.116
v0.8.115
v0.8.114
v0.8.113
v0.8.112
v0.8.111
v0.8.110
v0.8.109
v0.8.108
v0.8.107
v0.8.106
v0.8.105
v0.8.104
v0.8.103
v0.8.102
v0.8.101
v0.8.100
v0.8.99
v0.8.98
v0.8.97
v0.8.96
v0.8.95
v0.8.94
v0.8.93
v0.8.92
v0.8.91
v0.8.90
v0.8.89
v0.8.88
v0.8.87
v0.8.86
v0.8.85
v0.8.84
v0.8.83
v0.8.82
v0.8.81
v0.8.80
v0.8.79
v0.8.78
v0.8.77
v0.8.76
v0.8.75
v0.8.74
v0.8.73
v0.8.72
v0.8.71
v0.8.70
v0.8.69
v0.8.68
v0.8.67
v0.8.66
v0.8.65
v0.8.64
v0.8.63
v0.8.62
v0.8.61
v0.8.60
v0.8.59
v0.8.58
v0.8.57
v0.8.56
v0.8.55
v0.8.54
v0.8.53
v0.8.52
v0.8.51
v0.8.50
v0.8.49
v0.8.48
v0.8.47
v0.8.46
v0.8.45
v0.8.44
v0.8.43
v0.8.42
v0.8.41
v0.8.40
v0.8.39
v0.8.38
v0.8.37
v0.8.36
v0.8.35
v0.8.34
v0.8.33
v0.8.32
v0.8.31
v0.8.30
v0.8.29
v0.8.28
v0.8.27
v0.8.26
v0.8.25
v0.8.24
v0.8.23
v0.8.22
v0.8.21
v0.8.20
v0.8.19
v0.8.18
v0.8.17
v0.8.16
v0.8.15
v0.8.14
v0.8.13
v0.8.12
v0.8.11
v0.8.10
v0.8.9
v0.8.8
v0.8.7
v0.8.6
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.50
v0.7.49
v0.7.48
v0.7.47
v0.7.46
v0.7.45
v0.7.44
v0.7.43
v0.7.42
v0.7.41
v0.7.40
v0.7.39
v0.7.38
v0.7.37
v0.7.36
v0.7.35
v0.7.34
v0.7.33
v0.7.32
v0.7.31
v0.7.30
v0.7.29
v0.7.28
v0.7.27
v0.7.26
v0.7.25
v0.7.24
v0.7.23
v0.7.22
v0.7.21
v0.7.20
v0.7.19
v0.7.18
v0.7.17
v0.7.16
v0.7.15
v0.7.14
v0.7.13
v0.7.12
v0.7.11
v0.7.10
v0.7.9
v0.7.8
v0.7.7
v0.7.6
v0.7.5
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.69
v0.6.68
v0.6.67
v0.6.66
v0.6.65
v0.6.64
v0.6.63
v0.6.62
v0.6.61
v0.6.60
v0.6.59
v0.6.58
v0.6.57
v0.6.56
v0.6.55
v0.6.54
v0.6.53
v0.6.52
v0.6.51
v0.6.50
v0.6.49
v0.6.48
v0.6.47
v0.6.46
v0.6.45
v0.6.44
v0.6.43
v0.6.42
v0.6.41
v0.6.40
v0.6.39
v0.6.38
v0.6.37
v0.6.36
v0.6.35
v0.6.34
v0.6.33
v0.6.32
v0.6.31
v0.6.30
v0.6.29
v0.6.28
v0.6.27
v0.6.26
v0.6.25
v0.6.24
v0.6.23
v0.6.22
v0.6.21
v0.6.20
v0.6.19
v0.6.18
v0.6.17
v0.6.16
v0.6.15
v0.6.14
v0.6.13
v0.6.12
v0.6.11
v0.6.10
v0.6.9
v0.6.8
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.104
v0.5.103
v0.5.102
v0.5.101
v0.5.100
v0.5.99
v0.5.98
v0.5.97
v0.5.96
v0.5.95
v0.5.94
v0.5.93
v0.5.92
v0.5.91
v0.5.90
v0.5.89
v0.5.88
v0.5.87
v0.5.86
v0.5.85
v0.5.84
v0.5.83
v0.5.82
v0.5.81
v0.5.80
v0.5.79
v0.5.78
v0.5.77
v0.5.76
v0.5.75
v0.5.74
v0.5.73
v0.5.72
v0.5.71
v0.5.70
v0.5.69
v0.5.68
v0.5.67
v0.5.66
v0.5.65
v0.5.64
v0.5.63
v0.5.62
v0.5.61
v0.5.60
v0.5.59
v0.5.58
v0.5.57
v0.5.56
v0.5.55
v0.5.54
v0.5.53
v0.5.52
v0.5.51
v0.5.50
v0.5.49
v0.5.48
v0.5.47
v0.5.46
v0.5.45
v0.5.44
v0.5.43
v0.5.42
v0.5.41
v0.5.40
v0.5.39
v0.5.38
v0.5.37
v0.5.36
v0.5.35
v0.5.34
v0.5.33
v0.5.32
v0.5.31
v0.5.30
v0.5.29
v0.5.28
v0.5.27
v0.5.26
v0.5.25
v0.5.24
v0.5.23
v0.5.22
v0.5.21
v0.5.20
v0.5.19
v0.5.18
v0.5.17
v0.5.16
v0.5.15
v0.5.14
v0.5.13
v0.5.12
v0.5.11
v0.5.10
v0.5.9
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.42
v0.4.41
v0.4.40
v0.4.39
v0.4.38
v0.4.37
v0.4.36
v0.4.35
v0.4.34
v0.4.33
v0.4.32
v0.4.31
v0.4.30
v0.4.29
v0.4.28
v0.4.27
v0.4.26
v0.4.25
v0.4.24
v0.4.23
v0.4.22
v0.4.21
v0.4.20
v0.4.19
v0.4.18
v0.4.17
v0.4.16
v0.4.15
v0.4.14
v0.4.13
v0.4.12
v0.4.11
v0.4.10
v0.4.9
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.28
v0.3.27
v0.3.26
v0.3.25
v0.3.24
v0.3.23
v0.3.22
v0.3.21
v0.3.20
v0.3.19
v0.3.18
v0.3.17
v0.3.16
v0.3.15
v0.3.14
v0.3.13
v0.3.12
v0.3.11
v0.3.10
v0.3.9
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3a23
v0.3a22
v0.3a21
v0.3a20
v0.3a19
v0.3a18
v0.3a17
v0.3a16
v0.3a15
v0.3a14
v0.3a13
v0.3a12
v0.3a11
v0.3a10
v0.3a9
v0.3a8
v0.3a7
v0.3a6
v0.3a5
v0.3a4
v0.3a2
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference: rattail/tailbone#2
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I noticed this years ago but finally tried to solve this today, and no luck.
In the Products grid if you filter by e.g. "Vendor (any)" field contains "UNFI" then odds are reasonable this could, on the SQL level, return multiple matches per single product. SQLAlchemy is smart enough to "de-duplicate" these results such that a given product record will only appear once in the results. But unfortunately that is ORM magic and the underlying SQL statement of course does still return multiple rows, and hence the simple
query.count()
will return this "literal" number of rows.Result of this is, the grid may say there were 20K results (SQL rows) but in fact there may be only 15K products. And the grid may display only say 18 rows in a page whereas it says it is displaying rows 1-20 or whatever.
I had sort of assumed that I was doing something wrong with my joins etc. But when I was not able to figure that out, I searched online and arrived at the real reason (de-duplication mentioned above).
https://docs.sqlalchemy.org/en/20/faq/sessions.html#faq-query-deduplicating
Nice to see this is a known problem and not my poor code. But also sucks that it's not clear how to fix the Products grid here. Maybe the query could be smarter and use a sub-select statement to prevent the multiple rows per product within raw SQL? Will look another day..
In the meantime the good news is, I believe the grid behavior is still "determinate" in that if you page thru all the data, you should see it all. Just the overall and per-page counts will be inaccurate.
cf.
0ee6725188