posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat(hog): print ast in console

Open mariusandra opened this issue 1 year ago • 0 comments

Problem

image

Changes

image

Running print(expr) prints out the (unsanitized) SQL, just running expr in the console will still show the classes.

I couldn't get the latter to work even though there should be a __repr__(self) you can override.

I also added a to_hogql() function that just returns the printed HogQL.

How did you test this code?

See above

mariusandra avatar Oct 15 '24 18:10 mariusandra