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

feat(hog): sql nodes in repl #26084

Merged
merged 52 commits into from
Feb 3, 2025
Merged

feat(hog): sql nodes in repl #26084

merged 52 commits into from
Feb 3, 2025

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Nov 8, 2024

Problem

Supersedes https://github.com/PostHog/posthog/pull/25040/files

Changes

Add support for SQL nodes into the Hog repl.

image

TODO

  • JS HogQL printer (print(query) is unusable now)
  • Select as an alternative to args in a call (must do sql((select..)) with double ( now)
  • Assignment to a property returns last stack entry
  • Tests tests tests
  • Definitely make sure deserialize_hx_ast is safe and works as intended
  • Printing SQL in Python and comparing results not today
  • Pass the query to the backend as a printed string? keeping as an AST to make sure it just works

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

WIP. See above. Still tests to write.

@mariusandra mariusandra removed the stale label Nov 19, 2024
@posthog-bot posthog-bot closed this Dec 4, 2024
@mariusandra mariusandra reopened this Dec 4, 2024
@PostHog PostHog deleted a comment from posthog-bot Dec 4, 2024
@PostHog PostHog deleted a comment from posthog-bot Dec 4, 2024
@PostHog PostHog deleted a comment from posthog-bot Dec 4, 2024
@mariusandra mariusandra removed the stale label Dec 4, 2024
@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.

@posthog-bot
Copy link
Contributor

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

@mariusandra mariusandra reopened this Jan 6, 2025
@posthog-bot posthog-bot removed the stale label Jan 7, 2025
@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week. If you want to permanentely keep it open, use the waiting label.

@posthog-bot
Copy link
Contributor

It looks like the code of hogql-parser has changed since last push, but its version stayed the same at 1.0.456. 👀
Make sure to resolve this in hogql_parser/setup.py before merging!

@Twixes Twixes force-pushed the sql-ast-hogqlx-nodes branch from 2c6046c to 641bc53 Compare January 31, 2025 10:28
@posthog-bot
Copy link
Contributor

It looks like the code of hogql-parser has changed since last push, but its version stayed the same at 1.0.456. 👀
Make sure to resolve this in hogql_parser/setup.py before merging!

@Twixes Twixes force-pushed the sql-ast-hogqlx-nodes branch from 641bc53 to dc54dab Compare January 31, 2025 10:30
@Twixes Twixes temporarily deployed to pypi-hogql-parser January 31, 2025 10:42 — with GitHub Actions Inactive
@Twixes Twixes force-pushed the sql-ast-hogqlx-nodes branch from 955fc9d to b0c26f4 Compare January 31, 2025 11:11
@Twixes Twixes temporarily deployed to pypi-hogql-parser January 31, 2025 11:25 — with GitHub Actions Inactive
@posthog-bot
Copy link
Contributor

It looks like the code of hogql-parser has changed since last push, but its version stayed the same at 1.0.458. 👀
Make sure to resolve this in hogql_parser/setup.py before merging!

@Twixes Twixes deployed to pypi-hogql-parser January 31, 2025 12:40 — with GitHub Actions Active
@mariusandra mariusandra enabled auto-merge (squash) February 3, 2025 09:25
@PostHog PostHog deleted a comment from posthog-bot Feb 3, 2025
@mariusandra mariusandra merged commit 85f7589 into master Feb 3, 2025
102 checks passed
@mariusandra mariusandra deleted the sql-ast-hogqlx-nodes branch February 3, 2025 11:09
thmsobrmlr pushed a commit that referenced this pull request Feb 3, 2025
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.

4 participants