Commit graph

252 commits

Author SHA1 Message Date
Ankush Menat
f642b1881f fix: invalid select star expansions 2024-03-20 16:31:02 +05:30
Ankush Menat
5eca52b2c7 fix: only trim tab if it starts with tab 2024-03-20 12:29:58 +05:30
Ankush Menat
cc4e628edf fix: remove unnecessary dummy column 2024-03-20 12:29:58 +05:30
Ankush Menat
3facad0a25 fix: avoid parsing reserved keywords and simple strings 2024-03-20 12:29:58 +05:30
Ankush Menat
414b1beffd Revert "Revert "perf: cache fieldname extraction""
This reverts commit ffe84c9f9d.
2024-03-20 12:29:58 +05:30
Ankush Menat
ea193ecd48 Revert "Revert "fix: search_link fails when txt contains parentheses (#22892)""
This reverts commit c0cf13b8e8.
2024-03-20 12:29:57 +05:30
Ankush Menat
dbe55d4ace
perf: Avoid ordering in count query (#25451)
Order doesn't matter for count. This PR now actually makes https://github.com/frappe/frappe/pull/25348 effective
2024-03-14 15:03:27 +00:00
Ankush Menat
1fa7cc7816 fix: support child tables in count with limit 2024-03-12 13:17:31 +05:30
Ankush Menat
7e88c53aa4 perf: show estimated count on list view 2024-03-12 13:17:31 +05:30
Ankush Menat
a49fafbf8e feat: support countig till a limit
In InnoDB counting is essentially O(n) operation, it can be pretty fast
on indexes but when filters don't use any index it usually means doing a
full table scan.

Adding a limit will stop the scan as soon as that many records are
matched.
2024-03-12 13:17:28 +05:30
Ankush Menat
ae649aadf0 fix: dont add useless distinct clause
confuses query planner in some cases
2024-03-12 09:18:07 +05:30
Ankush Menat
4ab2ccd01f fix!: get_count accepts splatted arguments 2024-03-11 18:15:27 +05:30
Ankush Menat
a28921750d fix(DX): Avoid use of args in virtual doctype 2024-03-11 15:20:35 +05:30
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
c0cf13b8e8 Revert "fix: search_link fails when txt contains parentheses (#22892)"
This reverts commit 642e9f4ec1.
2024-01-17 12:44:20 +05:30
Ankush Menat
ffe84c9f9d Revert "perf: cache fieldname extraction"
This reverts commit c591fcc5c1.
2024-01-17 12:44:09 +05:30
Ankush Menat
c591fcc5c1 perf: cache fieldname extraction 2024-01-17 11:50:13 +05:30
Sambasiva Suda
642e9f4ec1
fix: search_link fails when txt contains parentheses (#22892)
* fix: search_link fails when txt contains parentheses

* fix: updating regex to replace number params also

* chore: replacing regex with sqlparse

* chore: not including fields like count(1) in asterisk_fields

* fix: owner/module not identified as column

* chore: lint fix and removing exception

* refactor: better function name

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-01-16 21:36:45 +05:30
Suraj Shetty
2564d0e939
Merge pull request #23512 from GursheenK/include-filter-values-in-exported-report-excel 2023-12-18 12:40:37 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Gursheen Anand
8a4d85a5ad fix: parse applied filter json before building data 2023-11-30 15:07:30 +05:30
mergify[bot]
d3c534e0cf
fix: attempt to not pass an empty string to json.loads (#23139) (#23141)
* fix: attempt to not pass an empty string to `json.loads`

* fix: ignore all falsy fields

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 6a8cf0689ae8e70f99ffd6957603d6583b4bdf92)

Co-authored-by: Arjun <contact@arjunchoudhary.com>
2023-11-07 20:04:20 +05:30
Ankush Menat
dfcb69ab21 refactor: use reportview get_count implementation
Count reported should be according to permissions
2023-10-16 18:13:50 +05:30
Ankush Menat
47538f7601 feat: doctype collection level APIs - meta, count 2023-10-16 18:13:50 +05:30
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
Ankush Menat
5841f29610 refactor: rename poorly named variables
stats are actually columns in DB
columns are for verifying if DB column exists hence db_columns
other stats was result.

Renamed everything to avoid confusion.
2023-07-15 12:34:49 +05:30
Shariq Ansari
f679930790 revert: last commit 2023-06-15 14:07:53 +05:30
Shariq Ansari
4ec2d5f00d fix: commit after successfull deletion of all tasks 2023-06-15 12:48:55 +05:30
Shariq Ansari
fd65fe8625 fix: clear throw message 2023-06-14 12:11:21 +05:30
Shariq Ansari
d1aea9981a fix: re-delete doc if dependent doc is deleted 2023-06-14 12:10:52 +05:30
ruthra kumar
6b2bcd5b07 fix: using 'Equals' and 'Is' on multiselect throws error 2023-05-18 16:48:19 +05:30
Gavin D'souza
52973ed85d fix(reportview): Use get_permitted_fields for resource API 2023-04-22 14:59:33 +05:30
Shariq Ansari
6b2b161876 fix: filter with capitalized operator was getting bypassed 2023-04-13 14:11:52 +05:30
Gavin D'souza
6b0e4695a8 Merge branch 'develop' into permlevel-apis 2023-01-25 12:08:47 +05:30
Gavin D'souza
e75bfd0e73 refactor: Split objects just once
Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-25 10:45:30 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Gavin D'souza
9efe84a644 fix(reportview): Remove aggregate_on_field added in fields
Essentially reverts changes added via
https://github.com/frappe/frappe/pull/14424 but works just the same
without the additional column :thonk:

The added column's data in mariadb was essentially garbage data. Wasn't
meaningful from what I could tell - couldn't play well with postgres
either
2023-01-20 19:26:56 +05:30
Gavin D'souza
9012b95a9a fix(postgres): group_by in reportview, tests
Add approporiate group_by, order_by clauses in reportview and tests for
featureset compatibility with postgres
2023-01-11 12:42:45 +05:30
Daizy Modi
d6c6df74db
fix: use doc.has_permission instead of frappe.has_permission (#19541) 2023-01-09 19:03:45 +05:30
jiangying
8273c9f244
chore: fix comment typo in frappe/desk/reportview.py (#19517) 2023-01-08 20:04:14 +05:30
barredterra
b1f6152f38 fix: pop from form_params 2022-11-28 12:19:14 +01:00
barredterra
ee18984e1f refactor: export_query 2022-11-28 12:15:57 +01:00
barredterra
5008bc0b09 fix: fieldname referenced before assignment 2022-11-28 12:15:30 +01:00
barredterra
d70e5e73e2 refactor: extract common methods 2022-11-26 20:00:58 +01:00
Raffael Meyer
cca25174ab
Merge branch 'develop' into csv-params 2022-11-14 12:38:51 +01:00
Ankush Menat
52ee21270e refactor: validation of permlevel 2022-11-10 14:15:24 +05:30
AMS Fauzi
ab35ec8f48
fix: reportview permlevel bug (#18822) 2022-11-10 13:05:10 +05:30
barredterra
a232e7f0c1 fix: don't parse CSV params for Excel 2022-10-29 18:05:52 +02:00