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

Add /charts/series ext api #279

Merged
merged 3 commits into from Jan 25, 2024
Merged

Add /charts/series ext api #279

merged 3 commits into from Jan 25, 2024

Conversation

MikeShi42
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Jan 25, 2024

⚠️ No Changeset found

Latest commit: 771aa57

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines 18 to 26
series: z.array(externalQueryChartSeriesSchema).refine(
series => {
const groupByFields = series[0].groupBy;
return series.every(s => _.isEqual(s.groupBy, groupByFields));
},
{
message: 'All series must have the same groupBy fields',
},
),
Copy link
Contributor

Choose a reason for hiding this comment

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

oh this is cool

Comment on lines 39 to 44
const internalSeries = series.map(s =>
translateExternalSeriesToInternalSeries({
type: 'time', // just to reuse the same fn
...s,
}),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can do this after team validation


return {
type,
data_source: table === 'metrics' ? 'metrics' : 'events',
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to make this guy camelcase ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦 yeah good point... there's a few places where I introduced the snake case. Let me do it in a follow up PR after this and the TF one is merged so I can change it everywhere at once.

Copy link
Contributor

@wrn14897 wrn14897 left a comment

Choose a reason for hiding this comment

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

lgtm

@kodiakhq kodiakhq bot merged commit 7dbb1d6 into main Jan 25, 2024
4 checks passed
@kodiakhq kodiakhq bot deleted the mikeshi/series-ext-api branch January 25, 2024 08:53
MikeShi42 added a commit that referenced this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants