-
Notifications
You must be signed in to change notification settings - Fork 117
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
Stricter types for Time dimension detail table #4154
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.
Nice work @djbarnwal. My main comment overall is: be careful of casting. If you find yourself doing it very much it means something is wrong and you should look into the upstream types you are working with and wrap them so that the need to cast doesn't flow into your downstream code.
For us, our API types are annoying limited, which means types don't flow through the system as easily as we'd like, but rather than casting at the endpoint, you should use type guards and wrappers as close to the data ingestion point as possible.
web-common/src/features/dashboards/time-series/timeseries-data-store.ts
Outdated
Show resolved
Hide resolved
web-common/src/features/dashboards/time-dimension-details/time-dimension-data-store.ts
Outdated
Show resolved
Hide resolved
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.
Nice!
This PR adds stricter types for Time dimension detail table. There are still some type warnings but we need better runtime support for some types.
For ex- values in
V1MetricsViewAggregationResponseDataItem
should not be typed asany