ref(resolvers): inline the time series resolver - #8453
Open
MeredithAnya wants to merge 1 commit into
Open
Conversation
This was referenced Sep 9, 2026
MeredithAnya
added this pull request to stack #8456
September 9, 2026 23:52
pbhandari
approved these changes
Sep 10, 2026
Comment on lines
+83
to
+88
| OP_TO_EXPR = { | ||
| ProtoExpression.BinaryFormula.OP_ADD: f.plus, | ||
| ProtoExpression.BinaryFormula.OP_SUBTRACT: f.minus, | ||
| ProtoExpression.BinaryFormula.OP_MULTIPLY: f.multiply, | ||
| ProtoExpression.BinaryFormula.OP_DIVIDE: f.divide, | ||
| } |
Contributor
There was a problem hiding this comment.
can we move this elsewhere to a common file?
This is probably something we want to make sure is the same constant used everywhere, and storing it inside an endpoint file discourages that usage and hampers discoverability.
ResolverTimeSeriesEAPItems was the only implementation of ResolverTimeSeries, so the trace_item_type dispatch could only ever return it. Move the resolver module body into endpoint_time_series.py and turn resolve() into _query_time_series, following 76d1fed. The resolver's snuba AST Expression collides with the endpoint's proto Expression, so _convert_aggregations_to_expressions now uses the resolver's existing ProtoExpression alias. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
MeredithAnya
force-pushed
the
meredith/convert-resolver-time-series
branch
from
September 10, 2026 19:50
373e00d to
75073d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
ref(resolvers): remove unused resolver declarationsref(resolvers): inline the trace item stats resolverref(resolvers): inline the time series resolverref(resolvers): inline the trace item table resolverref(resolvers): remove the TraceItemDataResolver abstractionWhat
Same transformation as #8452, applied to
EndpointTimeSeries.ResolverTimeSeriesEAPItemswas the only implementation ofResolverTimeSeries, so thetrace_item_typedispatch could only ever return it.Moves the resolver module body into
endpoint_time_series.py, turnsresolve()into_query_time_seriesreadingself.routing_decision.One thing to look at
The two modules disagreed on the name
Expression: the endpoint imported the proto one fromendpoint_time_series_pb2, the resolver imported the snuba AST one under that name and the proto one asProtoExpression. The merged module keeps the resolver's imports, so_convert_aggregations_to_expressionsnow constructsProtoExpression(...)instead ofExpression(...). Same object, no behavior change.Tests
Import/patch-target updates only.
pytest tests/web/rpc/v1/test_endpoint_time_series/ tests/web/rpc/v1/test_storage_routing.py→ 78 passed, 1 xfailed.mypy snuba/web/rpc/clean.🤖 Generated with Claude Code