8000 perf: reuse `_doc_before_save` in `doc.get_latest` by sagarvora · Pull Request #19326 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

perf: reuse _doc_before_save in doc.get_latest #19326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

sagarvora
Copy link
Contributor

No description provided.

@sagarvora sagarvora requested review from a team and phot0n and removed request for a team December 16, 2022 16:56
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Dec 16, 2022
@sagarvora sagarvora added backport version-13-hotfix backport version-14-hotfix backport to version 14 and removed add-test-cases Add test case to validate fix or enhancement labels Dec 16, 2022
@sagarvora
Copy link
Contributor Author
sagarvora commented Dec 16, 2022

The changes in test are limited to following renames:

parent_doc => parent_doctype
child_doc1 => child_doctype1
child_doc2 => child_doctype2
Parent Doc => Parent DocType
Child Doc1 => Child DocType1
Child Doc2 => Child DocType2
  • This was required as parent_doc was added as a reserved keyword.
  • Apart from this specific test, I couldn't find much issue with reserving the keyword. Ideally, we should've named it _parent_doc to begin with.
  • If required, this specific commit can be ignored from blame.

@codecov
Copy link
codecov bot commented Dec 16, 2022

Codecov Report

Merging #19326 (9ad9c39) into develop (1fbead1) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19326      +/-   ##
===========================================
- Coverage    64.68%   64.67%   -0.02%     
===========================================
  Files          754      754              
  Lines        70978    71300     +322     
  Branches      6117     6117              
===========================================
+ Hits         45915    46115     +200     
- Misses       21562    21684     +122     
  Partials      3501     3501              
Flag Coverage Δ
server 68.52% <66.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@ankush
Copy link
Member
ankush commented Dec 19, 2022

@ankush ankush merged commit a113207 into frappe:develop Dec 19, 2022
@ankush ankush deleted the get-latest-fix branch December 19, 2022 07:00
ankush pushed a commit that referenced this pull request Dec 19, 2022
…19346)

* perf: reuse `_doc_before_save` in `doc.get_latest`

(cherry picked from commit c453ad2)

* test: improve doctype and field naming

(cherry picked from commit 9ad9c39)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
ankush pushed a commit that referenced this pull request Dec 19, 2022
…19345)

* perf: reuse `_doc_before_save` in `doc.get_latest`

(cherry picked from commit c453ad2)

# Conflicts:
#	frappe/model/base_document.py

* test: improve doctype and field naming

(cherry picked from commit 9ad9c39)

# Conflicts:
#	frappe/tests/test_linked_with.py

* chore: resolve conflicts

* fix: add validation for reserved keywords when saving DocType (backport)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
frappe-pr-bot pushed a commit that referenced this pull request Dec 20, 2022
## [13.46.1](v13.46.0...v13.46.1) (2022-12-20)

### Bug Fixes

* allow zero page length in `get_list` to return complete list ([#19322](#19322)) ([#19340](#19340)) ([0dfa23d](0dfa23d))
* datepicker not working for arabic language ([7570256](7570256))
* dont share with self for standard users (backport [#19327](#19327)) ([#19337](#19337)) ([7d93bf0](7d93bf0))
* duplicate unique indexes (backport [#19291](#19291)) ([#19296](#19296)) ([b6e58a9](b6e58a9))
* move filelock import inside function ([e642684](e642684))
* restore missing `helpful` and `not_helpful` fields to help article doctype. (backport [#19309](#19309)) ([#19315](#19315)) ([90c4023](90c4023)), closes [#diff-3e0e1befb66af4c2ab84c6fe0e996dc602d906817f0b00b6239120af9da9be46](https://github.com/frappe/frappe/issues/diff-3e0e1befb66af4c2ab84c6fe0e996dc602d906817f0b00b6239120af9da9be46)
* untranslated link fields in list view ([#19155](#19155)) ([57b109e](57b109e))
* use stricter regex for `sanitize_searchfield` ([#19302](#19302)) ([1fbca36](1fbca36))
* **UX:** Redirect after submitting webform ([#19318](#19318)) ([d25a26b](d25a26b))

### Performance Improvements

* reuse `_doc_before_save` in `doc.get_latest` (backport [#19326](#19326)) ([#19345](#19345)) ([757b042](757b042))
frappe-pr-bot pushed a commit that referenced this pull request Dec 20, 2022
# [14.20.0](v14.19.1...v14.20.0) (2022-12-20)

### Bug Fixes

* allow zero page length in `get_list` to return complete list ([#19322](#19322)) ([#19341](#19341)) ([715aaa6](715aaa6))
* better check of whether doctype is child table ([#19329](#19329)) ([#19343](#19343)) ([0c0d1ef](0c0d1ef))
* datepicker not working for arabic language (backport [#19358](#19358)) ([#19361](#19361)) ([8d791cc](8d791cc))
* db ssl connection ([#19308](#19308)) ([#19339](#19339)) ([3bf65be](3bf65be))
* dont share with self for standard users (backport [#19327](#19327)) ([#19338](#19338)) ([a3be135](a3be135))
* duplicate unique indexes (backport [#19291](#19291)) ([#19297](#19297)) ([bc92e1c](bc92e1c))
* handle `HTML` code field's `has_content` ([9bc679e](9bc679e))
* if grid custom button is not set grid has some extra space on top ([4f19f68](4f19f68))
* in web form if print format is empty getting error ([f8e227c](f8e227c))
* move filelock import to function ([ee9b1aa](ee9b1aa))
* postgres query ([#19357](#19357)) ([#19359](#19359)) ([12ecae2](12ecae2))
* **postgres:** psql with remote databases (backport [#19362](#19362)) ([#19366](#19366)) ([60c853d](60c853d))
* restore missing `helpful` and `not_helpful` fields to help article doctype. ([#19309](#19309)) ([#19316](#19316)) ([3950865](3950865)), closes [#diff-3e0e1befb66af4c2ab84c6fe0e996dc602d906817f0b00b6239120af9da9be46](https://github.com/frappe/frappe/issues/diff-3e0e1befb66af4c2ab84c6fe0e996dc602d906817f0b00b6239120af9da9be46)
* sort prepared report filters ([#19267](#19267)) ([b3e16b8](b3e16b8))
* **trim-database:** Dont act on non-frappe tables (backport [#19292](#19292)) ([#19298](#19298)) ([34b2b24](34b2b24))
* use stricter regex for `sanitize_searchfield` (backport [#19277](#19277)) ([#19303](#19303)) ([4e870b3](4e870b3))
* **workflow:** Remove docstatus field from get_workflow_state_count ([#19332](#19332)) ([#19344](#19344)) ([34e8ecb](34e8ecb))

### Features

* add parameters language and letter_head to `download_pdf` ([99631d2](99631d2))
* fields for attaching (html) meta tags in web form (backport [#19306](#19306)) ([#19307](#19307)) ([6b0e585](6b0e585))

### Performance Improvements

* reuse `_doc_before_save` in `doc.get_latest` (backport [#19326](#19326)) ([#19346](#19346)) ([ff3de82](ff3de82))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0