* fix: Show server script name in traceback
* chore: typo
Co-authored-by: Sagar Vora <sagar@resilient.tech>
---------
Co-authored-by: Sagar Vora <sagar@resilient.tech>
This avoids having to manipulate config files in brittle bash
entrypoints that need to react to dynamic service discovery.
This significantly improves the operability of various bench sites.
* fix: pypika does not parse datetime.time
(cherry picked from commit b8f5a4304cccda954822cfe69d4805a18d9f07a7)
* fix: style - imports sort order fixed
(cherry picked from commit c3562c643ab9bff38d230202675d8ce1ae190912)
* test: add test for query builder parsing datetime.time
(cherry picked from commit 99889c270199da4b26b0d3858ae0f0a416d49d90)
* fix: format_time instead of format_datetime, test was failing!
(cherry picked from commit 5d697a22ac8cb98c8f8f44b3f99c57b932c5223c)
* fix(style): linter issues
(cherry picked from commit e231e1b0eadf63e84c9f81cfed9e2926e086fc44)
* test: add test for postgres
(cherry picked from commit 695591c43af9672cb83ce856a46c97e0bddfa9c3)
* fix: converting datepart and timepart to strings for Combinedatetime
(cherry picked from commit 1ebda943a607688bfb3db9fb42c80723a9050973)
* fix: style, linter issues
(cherry picked from commit c01262ad02b8831fdb0c5332b6973499e8adf6ad)
Co-authored-by: Anoop Kurungadam <anoop@earthianslive.com>
Co-authored-by: Aradhya <aradhyatripathi51@gmail.com>
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
* feat: supporting empty iterables for Contains objects
* fix: explicitly setting empty iterables as tuples to support more operators
* feat: Added locate to frappe.qb Functions
* feat: Added support for functions passed as strings in fields
* feat: Included Criterion objects as fields
* fix: picking up only function intended fields to pass to get_function_objects
* feat: Added iterable for available functions, added support for Field objects
* fix: fixed * passed in fields in lists
You would want to switch schemas in the same process. Eversince the
change
64e5273764
we stopped patching on every frappe.init call which meant, if a MariaDB
site was initialized first, frappe._qb_patched would be set to True and
if a Postgres site was initialized after, _qb_patched would be lying as
the PG engine isn't patched yet. Sooooo we need a Dict instead to
maintain this record of patching. This issue caused weird errors lol -
Traceback:
File "/home/frappe/Desktop/frappe-bench-dev/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/commands/__init__.py", line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/commands/site.py", line 524, in migrate
SiteMigration(
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/migrate.py", line 169, in run
self.setUp()
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/migrate.py", line 73, in setUp
clear_global_cache()
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/cache_manager.py", line 102, in clear_global_cache
clear_website_cache()
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/website/utils.py", line 374, in clear_website_cache
clear_cache(path)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/website/utils.py", line 369, in clear_cache
for method in frappe.get_hooks("website_clear_cache"):
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/__init__.py", line 1440, in get_hooks
hooks = _dict(_load_app_hooks())
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/caching.py", line 57, in wrapper
return_val = func(*args, **kwargs)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/__init__.py", line 1407, in _load_app_hooks
apps = [app_name] if app_name else get_installed_apps(sort=True)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/utils/caching.py", line 57, in wrapper
return_val = func(*args, **kwargs)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/__init__.py", line 1374, in get_installed_apps
installed = json.loads(db.get_global("installed_apps") or "[]")
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/database/database.py", line 917, in get_global
return self.get_default(key, user)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/database/database.py", line 921, in get_default
d = self.get_defaults(key, parent)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/database/database.py", line 938, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/defaults.py", line 88, in get_defaults
globald = get_defaults_for()
File "/home/frappe/Desktop/frappe-bench-dev/apps/frappe/frappe/defaults.py", line 218, in get_defaults_for
frappe.qb.from_(table)
TypeError: 'Field' object is not callable