Skip to content

Commit

Permalink
fix lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Nov 15, 2024
1 parent d318f9e commit 886534d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hogvm/__tests__/__snapshots__/lambdas.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function jsonStringify (value, spacing) {
if (spacing && typeof spacing === 'number' && spacing > 0) {
return JSON.stringify(convert(value), null, spacing)
}
return JSON.stringify(convert(value))
return JSON.stringify(convert(value), (key, val) => typeof val === 'function' ? `fn<${val.name || 'lambda'}(${val.length})>` : val)
}
function jsonParse (str) {
function convert(x) {
Expand Down
2 changes: 1 addition & 1 deletion posthog/hogql/compiler/javascript_stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
if (spacing && typeof spacing === 'number' && spacing > 0) {
return JSON.stringify(convert(value), null, spacing)
}
return JSON.stringify(convert(value))
return JSON.stringify(convert(value), (key, val) => typeof val === 'function' ? `fn<${val.name || 'lambda'}(${val.length})>` : val)
}""",
["__isHogDateTime", "__isHogDate", "__isHogError"],
],
Expand Down

0 comments on commit 886534d

Please sign in to comment.