-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Re-organize class hierarchy #34
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
base: main
Are you sure you want to change the base?
Conversation
| /** | ||
| * @title BooleanExpression | ||
| */ | ||
| export type BooleanExpression = |
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 changed expressions to be based on the type they resolve to rather than the type of the operand. This makes it possible for us to restrict the types of operands for various operators.
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.
The transpiler we're using to go from TS to JSON schema looks for @title in a comments so we can get rid of the add titles to schema script.
I added the necessary comments to all the types we're exposing and double checked the python doesn't have types with incorrect names.
|
|
||
| class PathExpression( | ||
| RootModel[Union[bool, float, str, UnaryPathExpression, BinaryPathExpression]] | ||
| class Expression( |
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.
One annoyance here that might be resolvable, the code gen tool to convert JSON schema to python puts this expression out of order. It puts it above NumberExpression so the python is invalid... I think that's just a bug with the tool, but it's easy enough to manually move it.
Instructions
developmentSummary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)