Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MarconLP
Copy link
Member

Changes

  • Changes the name of each hog template to only include the company name
  • Adds a category list to each hog template

slack context here: https://posthog.slack.com/archives/C01V9AT7DK4/p1725639369997959?thread_ts=1725526918.462859&cid=C01V9AT7DK4

2024-09-19 at 12 17 51

@MarconLP MarconLP changed the title Change template names feat(cdp): only include company name in hog name and add category list Sep 19, 2024
@MarconLP MarconLP requested review from a team and corywatilo September 19, 2024 10:26
@MarconLP MarconLP marked this pull request as ready for review September 19, 2024 10:26
Copy link
Contributor

@benjackwhite benjackwhite left a 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]
Copy link
Contributor

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

Copy link
Member Author

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
2024-09-19 at 13 55 55


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?

Copy link
Collaborator

@mariusandra mariusandra left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants