fix(bigquery/storage/managedwriter/adapt): schema->protodescriptor #6267
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 PR addresses a transitive dependency loss when working with nested
messages. Previously, we only constructed a descriptor using the direct
dependencies, and this changes the implementation to use the cache of
all encountered descriptors rather than the local list of dependencies.
There's still some opportunities for improvement with regards to
proto3, in particular the wrapper types. However, I'm deferring that
until we have that sorted out in the backend a bit better.
This also changes the testing slightly. I've added a comment to the
test as well, but our problem is evaluating the dependencies for
correctness. Due to the dynamic nature of how descriptors are created
we cannot use something like proto.Equal.
To address this, we make two comparisons. In the first, we check the
descriptor directly without its dependencies. In the second, we
call the normalizer to give us a self-contained descriptor proto, where
we can validate everything is present. The gap here of course is that
a bug in the normalizer may mask a problem with the conversion, so
consideration is warranted when we revisit this.
Fixes: #6258