-
-
Notifications
You must be signed in to change notification settings - Fork 57
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(subscriptions): Add create subscriptions RPC #6499
base: master
Are you sure you want to change the base?
feat(subscriptions): Add create subscriptions RPC #6499
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
rounded_ts = ( | ||
int(timestamp.replace(tzinfo=UTC).timestamp() / self.time_window_sec) | ||
* self.time_window_sec | ||
) |
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.
hack for now, we want to round this to the lowest available granularity (15s) more context here
if (self.request_name, self.request_version) not in REQUEST_TYPE_ALLOWLIST: | ||
raise InvalidSubscriptionError( | ||
f"{self.request_name} {self.request_version} not supported." | ||
) | ||
|
||
# TODO: Validate no group by, having, order by etc |
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'll add more validation in a follow up so it's easier to review
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.
Why can the create subscription RPC call not be its own PR?
@volokluev Creating a subscription requires validation, so I needed to build and run the request before storing it. That introduces the RPCSubscriptionData class. And basically once I introduced it in one place, I kinda had to follow all the typing issues and handle it everywhere. |
This PR adds a CreateSubscription RPC endpoint. There wasn't a clean way I could split this PR up into smaller chunks so I ended up adding rpc support for the entire the subscriptions pipeline (although a large chunk of it is test coverage).