Skip to content

Conversation

@gewenyu99
Copy link
Contributor

Problem

Variable names in sql editor get _ stripped out, BUT if you input a space, it gets turned into an _.

Screenshot 2025-10-03 at 2 22 28 PM Screenshot 2025-10-03 at 2 22 41 PM

This means hello_world turns into helloworld but hello world saves as hello_world.

Changes

  • Tool tip to allow alphanumerics and underscore specifically.
  • Frontend regex to allow _
  • Both hello world and hello_world gets mapped to {variable.hello_world}
  • No changes anywhere else

How did you test this code?

Manual testing

Screen.Recording.2025-10-03.at.2.35.19.PM.mov

Also tested in some queries

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Changelog: (features only) Is this feature complete?

@gewenyu99 gewenyu99 requested a review from a team October 3, 2025 18:49
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Size Change: 0 B

Total Size: 3.07 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 3.07 MB

compressed-size-action

@ivanagas
Copy link
Contributor

ivanagas commented Oct 6, 2025

awesome

// Filter out all characters that is not a letter, number or space
.replace(/[^a-zA-Z0-9\s]/g, '')
// Filter out all characters that is not a letter, number or space or underscore
.replace(/[^a-zA-Z0-9\s_]/g, '')
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooops good catch

@gewenyu99 gewenyu99 requested a review from Gilbert09 October 7, 2025 14:05
@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.

@gewenyu99
Copy link
Contributor Author

gewenyu99 commented Oct 16, 2025

@Gilbert09 What's the failing e2e test about?

Doesnt' look like this is related to my PR. Do I need a rebase?

Run depot/pull-action@8a922bdade29cf5facf3a13020cccd3b7a8127c2
Depot version
/opt/hostedtoolcache/depot/2.100.9/arm64/depot pull --tag posthog/posthog:98fcbfe20adddba831f3b1731e7b2b11b4b2b69f f4tglc292m
#1 pulling posthog/posthog:98fcbfe20adddba831f3b1731e7b2b11b4b2b69f
#1 ERROR: Error response from daemon: manifest for registry.depot.dev/x19jffd9zf:f4tglc292m not found: manifest unknown: Requested image not found
Error: Error response from daemon: manifest for registry.depot.dev/x19jffd9zf:f4tglc292m not found: manifest unknown: Requested image not found
Error: failed with: Error: Error response from daemon: manifest for registry.depot.dev/x19jffd9zf:f4tglc292m not found: manifest unknown: Requested image not found

Edit: Asked around, seems unrelated, I'm gonna move this PR forward it's pretty stale. Please yell at me on Slack if I broke something so I can take credit ;)

@gewenyu99 gewenyu99 merged commit 9f37811 into master Oct 16, 2025
204 of 209 checks passed
@gewenyu99 gewenyu99 deleted the sql-variable-names branch October 16, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants