Skip to content

#2114 repeating query in django view #2158

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 8 commits into from
Jul 10, 2025

Conversation

Pokapiec
Copy link
Contributor

@Pokapiec Pokapiec commented Nov 25, 2024

What does this pull request do?

In this PR i add another condition to elif statement in utils.encoding.transform function to handle displaying representation of django QuerySet object in custom way. We need to do it because if we try to execute repr function on unexecuted QuerySet which causes Timeout on database, it will execute by utils.encoding.transform function.

I also added a simple test simulating database Timeout.

Related issues

Closes #2114

Copy link

cla-checker-service bot commented Nov 25, 2024

💚 CLA has been signed

@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Nov 25, 2024
@Pokapiec
Copy link
Contributor Author

@xrmx this is the PR i created to resolve this issue #2114 we discussed earlier. I wanted to add this transformation logic to django contrib code but i couldn't make it work so i had to move it to transform func. Let me know if there is a better way.

@gtback
Copy link
Member

gtback commented Dec 11, 2024

cla/check

Copy link
Member

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't poke much with Django internals, also we should not assume django is installed

@pawelusermoc
Copy link
Contributor

@xrmx can you proceed reviewing this PR ?

@xrmx xrmx requested a review from a team as a code owner July 7, 2025 07:00
@xrmx
Copy link
Member

xrmx commented Jul 7, 2025

@pawelusermoc @Pokapiec pushed another commit to cleanup, does it work for you?

@xrmx xrmx requested a review from a team July 7, 2025 14:36
@xrmx xrmx requested a review from pawelusermoc July 9, 2025 07:12
@xrmx xrmx merged commit d521f30 into elastic:main Jul 10, 2025
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeating query in django view that failed due to OperationalError (timeout)
5 participants