0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
Commit Graph

34 Commits

Author SHA1 Message Date
Sandy Spicer
447a18930f
feat: add "INTERSECT" and "EXCEPT" to HogQL (#25737)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-29 11:31:56 -07:00
Marius Andra
9ff42460b9
feat(hogql): placeholder expressions (attempt 2) (#25216)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-26 12:33:37 +02:00
Marius Andra
57c22c3f16
feat(hog): make it fun (#24665) 2024-08-30 11:51:36 +02:00
Marius Andra
397919d6d9
feat(hog): parser updates for lambdas (#24575) 2024-08-27 11:21:36 +02:00
Marius Andra
0be448856b
feat(hog): escape curlies properly (#24311)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-12 16:30:52 +02:00
Tom Owers
59a15230fc
feat(data-warehouse): Added the ability to use dashboard filters in BI queries (#24033)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2024-07-31 13:20:23 +01:00
Tom Owers
f27b7b3904
feat(bi): Implemented a naive version of links for BI (#24013)
Co-authored-by: Marius Andra <marius.andra@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-26 14:03:37 +01:00
Marius Andra
c909bc9b88
fix(hog): c++ parser feedback (#24008)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-26 10:33:15 +02:00
Marius Andra
c64d94a26c
feat(hog): try catch (#23858) 2024-07-25 16:57:28 +02:00
Marius Andra
ffcede0bb8
fix(hog): 0-indexed array errors to resolver (#23676) 2024-07-12 16:07:11 +02:00
Marius Andra
0a2c3dca04
feat(hog): for in loops (#23631) 2024-07-11 18:34:21 +02:00
Marius Andra
5c90d21751
feat(hog): nullish coalescing (#23521)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-09 13:02:00 +02:00
Marius Andra
da8565f39c
fix(hog): C++ parser exception (#23232) 2024-06-25 21:52:29 +02:00
Marius Andra
01a9f360ad
feat(hog): C++ parser (#23100) 2024-06-21 11:22:39 -05:00
Marius Andra
249a9476e6
feat(hog): trailing commas (#23104) 2024-06-20 14:05:15 +00:00
Marius Andra
4e0c8f985f
feat(hog): for loops and nicer bytecode on /debug, (#22952) 2024-06-13 16:10:37 +00:00
Marius Andra
f6f25f0d42
fix(hog): release new parser (#22913) 2024-06-12 16:02:45 +02:00
Marius Andra
c2f6118406
fix(test): hog test regression (#22909)
* fix(test): hog test regression

* revert

* new version

* revert
2024-06-12 14:18:43 +01:00
Marius Andra
a98ed9281e
feat(hogql): window functions with params and args (#22862)
* feat(hogql): window functions with params and args

* Use new hogql-parser version

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-11 10:32:03 +01:00
Marius Andra
cb5260c8e0
fix(hog): property assigment via dots (#22659) 2024-06-04 15:24:59 +00:00
Marius Andra
0198ec7e1d
feat(hog): f-strings (#22577) 2024-05-30 20:32:39 +02:00
Marius Andra
45d275c4ee
feat(not-defining): Hog (#22336) 2024-05-28 14:51:45 +02:00
Thomas Obermüller
1812d8a523
feat(hogql): support join USING (replaces #21916) (#22378)
---------

Co-authored-by: Nikita Vorobev <nikitaevg@google.com>
2024-05-21 20:46:36 +02:00
Michael Matloka
715a8b924e
fix(hogql): Only expose HogQL exceptions relevant to users (#21329)
* fix(hogql): Only expose HogQL exceptions relevant to users

* Update http.py

* Use exposed exceptions more liberally

* Update more handling

* Update action.py

* Rename `Exception` to `Error`

* Use new hogql-parser version

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-05 11:39:20 +00:00
Marius Andra
8a0cdc161e
fix(trends): trim(leading 'x' from 'xo') support + breakdown url normalization (#21197) 2024-03-28 19:13:54 +01:00
Marius Andra
a661b4bcca
fix(hogql): remove unsupported extract(..from..) (#21157) 2024-03-27 17:05:09 +01:00
Tom Owers
d946f661f2
feat(hogql): Allow a placeholder to be used in place of a select statement (#19767)
* Allow a placeholder to be used in place of a select statement in a union all

* Updated the hogql parser version

* Use new hogql-parser version

* Fixed tests

* Update query snapshots

* Update query snapshots

* Rejigged the g4 file

* Updated mypy

* Updated mypy

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-18 15:14:39 +00:00
Michael Matloka
21c699772c
chore(hogql): Use the C++ parser in 50% of queries (#18298)
* chore(hogql): Use the C++ parser in 50% of queries

* Ensure that C++ parser is used in tests deterministically

* Align table args behavior with Python

* Bump parser version to 1.0.1

* Use new hogql-parser version

* Don't add notices for internal expressions, like in Python

* Bump parser version to 1.0.2

* Use new hogql-parser version

* Update posthog/hogql/parser.py

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-01 11:52:44 +01:00
Michael Matloka
8f62e85c9d
chore(hogql): Full error & NULL handling in C++ parser (1.0.0) (#18240)
* chore(hogql): Be defensive against NULLs in the C++ parser

* Clean up on C++ exceptions

* Add to CONTRIBUTING guide

* Revert `AllowShortFunctionsOnASingleLine` change

* Update HogQLX additions too

* Bump version to 1.0.0

* Use new hogql-parser version

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-27 13:37:15 +02:00
Marius Andra
4ea13f1c84
feat(hogqlx): nested tags (#18213) 2023-10-27 09:03:54 +02:00
Marius Andra
15e3e851ad
feat(hogql): HogQLX (#18097) 2023-10-26 14:22:22 +02:00
Tom Owers
8577e13599
feat: allow placeholders in place of ratio expressions in hogql (#17973)
* Allow placeholders in place of ratio expressions in hogql

* Added C++ changes for RatioExpr

* Bump `hogql_parser` version

* Upgrade ANTLR version to align with brew latest

* Update query snapshots

* Fix parser change message body

The quotes weren't right, so the step failed instead of posting a comment.

* Revert "Update query snapshots"

This reverts commit 1302d3b24f.

* Update MD5 sum

* Bump version again

* Use new hogql-parser version

---------

Co-authored-by: Michael Matloka <michal@matloka.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2023-10-19 15:37:32 +00:00
Michael Matloka
711f2b4ac3
perf(hogql): Fix C++ parser leaks (#18022) 2023-10-17 15:27:38 +02:00
Michael Matloka
16a71f60c9
perf: Parse HogQL with C++ for a huge speedup (#17659)
* Add partial C++ parser of HogQL

* Support all the rules and add proper error handling

* Use `AlignAfterOpenBracket: BlockIndent`

* Reuse all the parser tests for the C++ backend

* Fix relationship between headers and implementations

* Add more error handling and fix minor issues

* Build both Python and C++ parsers in the package.json script

* Update ARRAY JOIN error assertion

* Improve timeit

* Move the C extension to the top level

* Refactor `vector_to_list_string`

* Build the parser on Linux

* Build wheels for the parser

* Simplify Linux build and fix macOS

* Fix Homebrew paths on x86 and don't fail fast in CI

* Set MACOSX_DEPLOYMENT_TARGET for C++20

* Set up QEMU for Linux ARM builds

* Publish the wheels on PyPI

* Avoiding Linux ARM emulation in CI for now

* Build sdist too

* Revert Dockerfile changes

* Fix PyPI publish

* Add README and optimize sdist build

* Use setup.py directly instead of build

* Use PyPI hogql-parser instead of local

* Also revert production-unit.Dockerfile

* Fix sdist upload and add Linux ARM back

* No Linux ARM build in the end

* Fix artifact uploading

* Do try building Linux ARM

We need this for prod.

* Use `npm` in `grammar:build`

`pnpm` is not available in that job.

* Fix formatting of hogql_parser

* Build everything on macOS

* Revert "Build everything on macOS"

Not so fast actually.

* Use hogql-parser=0.1.1

* Fix dylib in macOS wheel

* Bump hogql-parser version

* Fix missing module error

* Delete timeit.py

* Make error handling robust

* Format the C++

* Use `hogql-parser==0.1.1`

* Fix reserved keyword error assertions

* Use HEAD hogql_paresr in CI

* Fix `apt` usage

* Add some sudo in CI

* Ensure package will be releasable before build

* Bump version to 0.1.3

* Cover C++ `unquote_string` with tests

* Use BuildJet ARM runners for ARM builds

* Add some instructions

* Add HogQL version check to backend CI

* Update requirements.txt

* Use `setuptools` instead of the deprecated `distutils`

* Fix working dir in backend CI

* Align ANTLR versions

* Add test for "mismatched input"

This is thrown differently than other HogQLSyntaxExceptions in C++, so might help reveal what's going on with tests failing only on Linux CI and not macOS dev

* Add types and bump version

* Comment instead of failing version check

* Automate hogql-release version bump

* Fix checkout token

* Don't build hogql-parser if there were no changes

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Improve documentation

* Use new hogql-parser version

* Fix error start and end initialization

* Note `antlr4-cpp-runtime`

Co-authored-by: Marius Andra <marius.andra@gmail.com>

* Also remove NUL chars in C++

* Check ANTLR4 runtime archive checksum for security

* Note more decrefs to add

* Add vector size checks

* Use new hogql-parser version

* Don't support the `start` arg in C++ `parse_expr`

* Use new hogql-parser version

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marius Andra <marius.andra@gmail.com>
2023-10-13 13:58:08 +00:00