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(queries): standardise on "results" over "result" #17798

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

mariusandra
Copy link
Collaborator

Problem

Some query nodes return their results as result, some as results.

Changes

Standardises all on results, as this is what the currently publicly exposed EventsQuery and HogQLQuery use.

Also, we almost always have more than one "result", so plural makes sense to me.

How did you test this code?

The HogQL powered lifecycle insight loaded. Both in its cached and refreshed form... though I'm not sure what I don't know about all of this, so 👀 appreciated!

@mariusandra mariusandra requested a review from thmsobrmlr October 5, 2023 10:02
Copy link
Contributor

@thmsobrmlr thmsobrmlr left a comment

Choose a reason for hiding this comment

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

This makes sense and the change in insightDataLogic should be enough to ensure compatibility, though I'll check in detail later.

@mariusandra
Copy link
Collaborator Author

Thanks! I'm likely going to merge this into my PersonsQuery PR, as the pydantic validation errors about result vs results in the QueryResponse was what triggered this PR.

@thmsobrmlr thmsobrmlr self-requested a review October 5, 2023 16:11
Copy link
Contributor

@thmsobrmlr thmsobrmlr left a comment

Choose a reason for hiding this comment

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

Found one place where we need to adapt the logic https://github.com/PostHog/posthog/blob/master/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts#L69. Caching and all other places I though of look fine 🤞

frontend/src/scenes/insights/insightDataLogic.ts Outdated Show resolved Hide resolved
@mariusandra mariusandra merged commit 7dfab45 into master Oct 6, 2023
@mariusandra mariusandra deleted the query-response-results branch October 6, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants