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

Stricter types for Time dimension detail table #4154

Merged
merged 15 commits into from
Feb 27, 2024
Merged

Stricter types for Time dimension detail table #4154

merged 15 commits into from
Feb 27, 2024

Conversation

djbarnwal
Copy link
Member

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 as any

Copy link
Contributor

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

Copy link
Contributor

@bcolloran bcolloran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@djbarnwal djbarnwal merged commit c24a0d2 into main Feb 27, 2024
4 checks passed
@djbarnwal djbarnwal deleted the tdd-type-fixes branch February 27, 2024 09:33
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.

2 participants