-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cdp): only include company name in hog name and add category list #25069
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense. I was originally intending that the name should be more verbose so that it is clear what the various things do but I guess thats what the description is for.
@@ -31,6 +31,7 @@ class HogFunctionTemplate: | |||
description: str | |||
hog: str | |||
inputs_schema: list[dict] | |||
category: list[str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah one thing - you need to add this to the api serializer as well otherwise it wont get returned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure here
So in my local instance I already see the category field returned from this endpoint http://localhost:8000/api/projects/1/hog_function_templates/?format=json
When adding category
to this list here, I am starting to get this error:
ImproperlyConfigured: Field name `category` is not valid for model `HogFunction` in `posthog.api.hog_function.HogFunctionSerializer
That probably means I'll have to add category
to the hog function model, but I don't think we want to do that, because we only need the category on the hardcoded templates anyway.
Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense. I was originally intending that the name should be more verbose so that it is clear what the various things do but I guess thats what the description is for.
In reality the name and description were duplicating information most of the time, and the verbosity in the name made it hard to find what you were looking for quickly. So I'm happy with this change.
We could also just sort the list now... and just leave Slack and HTTP on top.
Changes
slack context here: https://posthog.slack.com/archives/C01V9AT7DK4/p1725639369997959?thread_ts=1725526918.462859&cid=C01V9AT7DK4