Skip to content

Commit

Permalink
fix(cdp): use postHogCapture everywhere (#25515)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Oct 11, 2024
1 parent 717463c commit 8ff686d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin-server/tests/cdp/hog-executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ describe('Hog Executor', () => {
])
})

it('ignores events that have already used their posthogCapture', () => {
it('ignores events that have already used their postHogCapture', () => {
const fn = createHogFunction({
...HOG_EXAMPLES.posthog_capture,
...HOG_INPUTS_EXAMPLES.simple_fetch,
Expand Down
2 changes: 1 addition & 1 deletion posthog/cdp/templates/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setUp(self):
side_effect=lambda *args: print("[DEBUG HogFunctionFetch]", *args) or self.mock_fetch_response(*args) # noqa: T201
)
self.mock_posthog_capture = MagicMock(
side_effect=lambda *args: print("[DEBUG HogFunctionPosthogCapture]", *args) # noqa: T201
side_effect=lambda *args: print("[DEBUG HogFunctionPostHogCapture]", *args) # noqa: T201
)

mock_fetch_response = lambda *args: {"status": 200, "body": {}}
Expand Down
4 changes: 2 additions & 2 deletions posthog/hogql/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def get_hogql_metadata(
)
if query.language == HogLanguage.HOG:
program = parse_program(query.query)
create_bytecode(program, supported_functions={"fetch", "posthogCapture"}, args=[], context=context)
create_bytecode(program, supported_functions={"fetch", "postHogCapture"}, args=[], context=context)
elif query.language == HogLanguage.HOG_TEMPLATE:
string = parse_string_template(query.query)
create_bytecode(string, supported_functions={"fetch", "posthogCapture"}, args=[], context=context)
create_bytecode(string, supported_functions={"fetch", "postHogCapture"}, args=[], context=context)
elif query.language == HogLanguage.HOG_QL_EXPR:
node = parse_expr(query.query)
if query.sourceQuery is not None:
Expand Down

0 comments on commit 8ff686d

Please sign in to comment.