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

feat: update all gql schemas and fix typings issues #98

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

obs-gh-alexlew
Copy link
Contributor

No description provided.

@@ -61,8 +61,10 @@ func (client *Client) ListDatasets(ctx context.Context) (ds []*Dataset, err erro
return nil, err
}
result := make([]*Dataset, 0)
for _, d := range resp.Datasets {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change for typings change from array of pointers to array of structs

for _, stage := range monitor.Query.Stages {
stages = append(stages, &stage)
}
stageIds, err := flattenAndSetQuery(data, stages, monitor.Query.OutputStage)
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels like you could adjust flattenAndSetQuery to accept []Stage here? That would save you having to dupe the logic at the only two caller sites.

if len(gqlstages) == 0 {
return make([]string, 0), nil
}

queryData, err := flattenQuery(gqlstages, outputStage)
inputstages := make([]*gql.StageQuery, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

You know the length here is going to be len(gqlstages)

for _, stage := range gqlstages {
inputstages = append(inputstages, &stage)
}
queryData, err := flattenQuery(inputstages, outputStage)
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep changing the signatures. This is the only caller for flattenQuery, so you should just pass gqlstages as is.

@obs-gh-alexlew obs-gh-alexlew assigned jta and unassigned jta Jan 17, 2024
@obs-gh-alexlew obs-gh-alexlew merged commit 2092826 into master Jan 23, 2024
4 of 5 checks passed
@obs-gh-alexlew obs-gh-alexlew deleted the alew/update-all-gql-schemas branch January 23, 2024 22: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