Skip to content
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

fix: add warning to document.get since it doesn't match dict.get and make more robust #26279

Closed
wants to merge 1 commit into from

Conversation

casesolved-co-uk
Copy link
Contributor

@casesolved-co-uk casesolved-co-uk commented May 1, 2024

It would be very easy to mistake document.get for python dict.get or frappe _dict.get but they have very different usage:

document.get(key, filters=None, limit=None, default=None)

dict.get(key[, default])

Potential fix / illustration for #26280

version-14-hotfix
version-15-hotfix

@casesolved-co-uk casesolved-co-uk requested a review from a team as a code owner May 1, 2024 15:24
@casesolved-co-uk casesolved-co-uk requested review from ankush and removed request for a team May 1, 2024 15:24
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label May 1, 2024
@casesolved-co-uk
Copy link
Contributor Author

casesolved-co-uk commented May 1, 2024

Due to the sheer number of warnings in the tests, the function default clearly needs to be changed to match dict.get()

So you would need to refactor all calls that need the filters parameter to specify filters= first

See #26281

@ankush
Copy link
Member

ankush commented May 3, 2024

ig the other PR is supposed to be merged (?)

@ankush ankush closed this May 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants