Commit graph

129 commits

Author SHA1 Message Date
Aarol D'Souza
08793c57f7
fix: force type check in whitelisted methods 2 (#37086)
* fix(diff): add type hints to whitelisted methods

* fix(global_search): add type hints to whitelisted methods

* fix(custom_html_block): add type hints to whitelisted methods

* fix(deleted_document): add type hints to whitelisted methods

* fix(log_settings): add type hints to whitelisted methods

* fix(role): add type hints to whitelisted methods

* fix(user_type): add type hints to whitelisted methods

* fix(rq_job): add type hints to whitelisted methods

* fix(link_preview): add type hints to whitelisted methods

* fix(email_account): add type hints to whitelisted methods

* fix(web_form): add type hints to whitelisted methods

* fix(web_page_view): add type hints to whitelisted methods

* fix(csvutils): add type hints to whitelisted methods

* fix(file_manager): add type hints to whitelisted methods

* fix(email_body): add type hints to whitelisted methods

* fix(email_queue): add type hints to whitelisted methods

* fix(email_template): add type hints to whitelisted methods

* fix(notification): add type hints to whitelisted methods

* fix(email_group): add type hints to whitelisted methods

* fix(inbox): add type hints to whitelisted methods

* fix(recorder): add type hints to whitelisted methods

* fix(sms_settings): add type hints to whitelisted methods

* fix: tighten type hints

* fix(data_import): add type hints to whitelisted methods

* fix(user_permission): add type hints to whitelisted methods

* fix(gantt): add type hints to whitelisted methods

* fix(like): add type hints to whitelisted methods

* fix(search): add type hints to whitelisted methods

* fix(onboarding_step): add type hints to whitelisted methods

* fix(system_console): add type hints to whitelisted methods

* fix(workspace_sidebar): add type hints to whitelisted methods

* fix(todo): add type hints to whitelisted methods

* fix: correct type hints

* fix(print_format): add type hints to whitelisted methods

* fix(client): add type hints to whitelisted methods
2026-02-19 14:58:16 +05:30
Ankush Menat
f7e594a618 fix: Update value if conflicting 2025-11-14 10:54:38 +05:30
Ankush Menat
e8961aee80 fix: Dont fail silently in tests 2025-11-14 10:52:47 +05:30
Ankush Menat
fd29e9c464
fix: Smaller batch size for global search (#32720)
10K is quite large for a single batch.
2025-05-29 17:13:01 +00:00
Ankush Menat
31e672f985
perf: 10000s of times faster global search (#32147)
In a new installment of *"how did it ever work"* - global search wasn't
filtering by the matched filter, just ranking. I have no idea why this
is being done here but it's far from a good idea from performance POV.

Not adding `MATCH` in where clause makes the fulltext index worthless.
2025-04-16 09:06:00 +05:30
Akhil Narang
ad32216040
fix: support sqlite
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-04-15 13:59:16 +05:30
Nikhil Kothari
9c6f25afb0
fix: fetch data from submitted child rows for global search indexing (#31405) 2025-02-24 18:27:47 +05:30
Maxim Sysoev
87b1e68081
feat: (UI) Show document title in Global Search result (#29131)
Showing title in n Global Search result, if title field set in doctype settings
2025-02-11 14:41:58 +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
0aa3b51faa fix: single global search sync
closes https://github.com/frappe/frappe/issues/23106
2023-11-06 20:29:16 +05:30
mergify[bot]
6ad2e762d3
Merge pull request #23064 from frappe/bulk-insert-search-sync
perf(GlobalSearch): bulk insert queued items
2023-11-03 05:10:31 +00:00
Ankush Menat
8c74d542d5 perf: don't check len before popping
rpop is atomic and yields None when nothing is found. No need to check length.
2023-11-03 10:20:31 +05:30
Ankush Menat
eba499a9ba refactor: misc changes
- make internal function explicit
- dont delete keys which is immediately being replaced.
- deprecate `sync_value`
2023-11-03 10:15:52 +05:30
18alantom
3d7ba41583 fix(sync_values): use EXCLUDED for postgres
removing the second arg from `do_update` causes
EXCLUDE to be auto added
2023-11-02 18:57:51 +05:30
18alantom
aa690553cf refactor: undo use of count in redis pop
count param in rpop and lpop was introduced in 6.20
at the time of this commit we are using an older
version that does not include it
2023-11-02 18:22:50 +05:30
18alantom
ee3776f38f refactor: move inner for to function 2023-11-02 17:02:49 +05:30
18alantom
64adf49706 refactor: use rpop count to pop in batches
- fix: dedupe items in a batch
- fix: reassign `query` cause it does not hold state

_fkn ORMs man 🙄_
2023-11-02 16:58:10 +05:30
18alantom
2742746ced perf(GlobalSearch): bulk insert queued items
Fixes #14660
2023-11-02 13:30:56 +05:30
Ankush Menat
db01c05eb8 fix: enforce perms on global search 2023-10-31 21:37:30 +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
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +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
06cf18d0aa chore: Add optional typing hints for params with default None 2022-12-15 13:47:05 +05:30
Gavin D'souza
d3250f6504 refactor(whitelisted): Add typing hints to APIs
* Refactor type checks defined in APIs
* Remove dead/deprecated kwargs usages
* Added appropriate hints to APIs and consecutive utils defined in the following modules:
 - frappe.realtime
 - frappe.translate
 - frappe.utils.global_search
 - frappe.www.third_party_apps
 - frappe.www.search
 - frappe.www.printview
2022-12-15 13:47:05 +05:30
Gavin D'souza
3863d9bb80 fix(global_search): Trigger rebuilding on Custom Field's property change 2022-08-02 14:49:04 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
chillaranand
1d763a6659 refactor: Fix flake8 issues 2022-05-19 15:34:35 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Suraj Shetty
42643c3faa fix: Follow FIFO while inserting global search record
the latest enqueued value should override the value of the existing document
2022-04-01 18:47:05 +05:30
phot0n
bebc8058b6 feat: integer primary keys 2022-03-11 23:46:00 +05:30
Gavin D'souza
65864c027f chore: Update module license header
These modules were imported from the ERPNext codebase into Frappe.
License header was overlooked at that point. These were contributed
initially by Frappe Technologies Pvt Ltd under GPLv3 (ERPNext's license) and now
we, as Frappe Technologies Pvt Ltd converting them to MIT to comply with
Frappe's license.
2021-09-03 11:51:01 +05:30
Gavin D'souza
30cf8fd58d refactor: Use run instead of frappe.db.sql 2021-08-12 18:36:43 +05:30
Gavin D'souza
1015283731 fix(global_search): Typecast variable for comparision
Previously start was being type casted with int. That was reverted by refactoring query to use new Query Builder
This bug was introduced via ee3c84beef
2021-08-12 16:23:40 +05:30
saxenabhishek
7671e78487 style: minor fixes and improvements 2021-07-30 11:29:41 +05:30
saxenabhishek
ce10e36725 refactor: move all pypika functions to a module 2021-07-30 11:00:35 +05:30
saxenabhishek
ee3c84beef style: typecast to string inside db.sql 2021-07-30 11:00:35 +05:30
saxenabhishek
c05a032811 refactor: qb in global_search.search 2021-07-30 11:00:34 +05:30
Aradhya-Tripathi
84ff1d0af9 style: removed frappe.db.sql comments 2021-07-28 13:48:01 +05:30
Aradhya-Tripathi
8887836820 refactor: Moved util queries to
frappe orm
2021-07-21 23:31:15 +05:30
Bhavesh Maheshwari
68930a022a
fix: Duplicate if condition remove 2021-07-13 15:55:24 +05:30
Suraj Shetty
2d8c6c1710 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-03 11:43:28 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
68aa1805aa fix: Exception handling 2021-05-19 14:03:31 +05:30
Suraj Shetty
c5b9815248 fix: Add get_response_content to get page content 2021-05-14 23:43:36 +05:30
Suraj Shetty
18497989dc refactor: Remove render_page from render.py
& replace all usages of render_page with get_response
2021-05-14 21:30:28 +05:30
Suraj Shetty
3c4306c87a refactor: Fix regex to avoid deprecation warnings 2021-05-10 09:18:50 +05:30
Aditya Hase
637aa059b9
perf: Remove BeautifulSoup from import tree 2021-02-19 21:01:55 +05:30