* perf: `Document` objects without circular references
Circular references are usuallly considered bad for GC, avoiding them
since they don't seem to be necessary.
* fix: explicitly convert to weakref
* 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>
* fix: set 2 as simultaneous_sessions by default
* fix: Correct offset for simultaneous_sessions
* refactor: use freeze_time instead of patching
* chore: misleading docstring
* test: set lower simultaneous_sessions for test
(single quotes would force it to lowercase)
Also unconditionally create a new user while running tests - we're gonna be dropping the test site
Don't pass a `None` value to bench cli
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
If you're reading 1000s of rows from MySQL, the default behaviour is to
read all of them in memory at once.
One of the use case for reading large rows is reporting where a lot of
data is read and then processed in Python. The read row is hoever not
used again but still consumes memory until entire function exits.
SSCursor (Server Side Cursor) allows fetching one row at a time.
Note: This is slower than fetching everything at once AND has risk of
connection loss. So, don't use this as a crutch. If possible rewrite
code so processing is done in SQL.
* Revert "fix(test_recorder): get the correct request (#24143)"
This reverts commit 745080c56e.
* test: disable recording before running assertions
* test: Dont set emails in test for broken email setup
BREAKING CHANGE:
before: `has_permission` hooks need to explicitly return "False" to block a user.
after: `has_permission` hook need to explicitly return "True" (or truthy) value to allow user. They will be blocked otherwise.
Why? Everything related to permission should be block by default and allow if some checks pass.
We set defaults on creation of new doc but when you append a new child
doc on existing document it doesn't seem to set the defaults.
This seems like a bug and not a deliberate choice.
Drop mandatory, assume sane defaults
The current implementation broke old users of redirects like helpdesk app
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
* feat: `describe-database-table` to get stats about a table
This provides description of table, indexes, total row count in machine
parseable format.
Towards https://github.com/frappe/press/issues/1265
* Update test_commands.py
People ususally write queries like these...
```
frappe.get_all(doctype, {"name": ("in", list_of_docs))
```
Ocassionally, the `list_of_docs` is empty because it's dynamically
generated and in this case we end up doing full table scan to find... nothing!