Merged
Conversation
This will make sure that single resources are validated at the sync stage and wont be passed to desitnations so it wont fail batches in any of CQ destinations.
⏱️ Benchmark results
|
hermanschaaf
approved these changes
Jan 2, 2023
schema/resource.go
Outdated
Comment on lines
+104
to
+105
| // Validates various constraints. for exmaple | ||
| // does all primary keys has values |
Contributor
There was a problem hiding this comment.
Suggested change
| // Validates various constraints. for exmaple | |
| // does all primary keys has values | |
| // Validates various constraints. For example, | |
| // checks that all primary keys have values. |
plugins/source/scheduler_dfs.go
Outdated
| if resolvedResource == nil { | ||
| return | ||
| } | ||
| tableMetrics := p.metrics.TableClient[table.Name][client.ID()] |
Contributor
There was a problem hiding this comment.
Maybe this lookup should happen inside the if below it, because that's the only place it's used?
erezrokah
approved these changes
Jan 2, 2023
Member
erezrokah
left a comment
There was a problem hiding this comment.
Looks good, nothing blocking
|
|
||
| // Validates various constraints. For example: Does all primary keys has values. | ||
| func (r *Resource) Validate() error { | ||
| for i, c := range r.Table.Columns { |
Member
There was a problem hiding this comment.
How about we don't return early and report in case multiple primary keys are missing instead of only returning the first error?
Contributor
Author
There was a problem hiding this comment.
Good idea. Added.
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
erezrokah
pushed a commit
that referenced
this pull request
Jan 3, 2023
🤖 I have created a release *beep* *boop* --- ## [1.17.0](v1.16.1...v1.17.0) (2023-01-02) ### Features * Add primary key validation ([#563](#563)) ([09f891a](09f891a)) ### Bug Fixes * **testing:** Sort results before comparison in tests ([#561](#561)) ([587715d](587715d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Member
|
FYI, this validation caught an issue in our tests, see cloudquery/cloudquery@5fc8b1f and https://github.com/cloudquery/cloudquery/actions/runs/3828313454/jobs/6513763728#step:7:115 |
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.
No description provided.