fix: Filter results of getTablesForSpec to top-level tables in CLI#5294
Merged
kodiakhq[bot] merged 1 commit intomainfrom Dec 2, 2022
Merged
fix: Filter results of getTablesForSpec to top-level tables in CLI#5294kodiakhq[bot] merged 1 commit intomainfrom
kodiakhq[bot] merged 1 commit intomainfrom
Conversation
candiduslynx
approved these changes
Dec 2, 2022
disq
reviewed
Dec 2, 2022
| func topLevelTables(allTables, tables schema.Tables) schema.Tables { | ||
| var top schema.Tables | ||
| for _, t := range tables { | ||
| if allTables.GetTopLevel(t.Name) == nil { |
Member
There was a problem hiding this comment.
Why do it this way, rather than checking if t.Parent is nil?
Contributor
Author
There was a problem hiding this comment.
Yeah, that was what I tried initially. Then I realized that the object we get back from getTablesFromSpec is deserialized from JSON, so it loses all the pointers that were present in the original object. For this reason it also isn't simple to set the parent pointers first and then checking t.Parent for nil. I felt like this solution is the cleanest for now.
Member
There was a problem hiding this comment.
We might need to reestablish those pointers/table references in a later release.
This was referenced Dec 2, 2022
yevgenypats
approved these changes
Dec 2, 2022
kodiakhq bot
pushed a commit
that referenced
this pull request
Dec 2, 2022
🤖 I have created a release *beep* *boop* --- ## [2.0.23](cli-v2.0.22...cli-v2.0.23) (2022-12-02) ### Bug Fixes * **deps:** Update module google.golang.org/grpc to v1.51.0 ([#5231](#5231)) ([2498d05](2498d05)) * Filter results of getTablesForSpec to top-level tables in CLI ([#5294](#5294)) ([768e0c5](768e0c5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
This fixes a hanging bug in recent versions of the CLI and some destination plugins (e.g. BigQuery, Snowflake). The actual bug is in the
GetTablesForSpecSDK function, which should not return a flattened list of tables, but this fix for the CLI means the CLI will work with any version ofGetTablesForSpec(even versions with the bug).I will follow up shortly with a fix for the SDK.