Fix(ingest/bigquery): fix extracting comments from complex types (#8950)

Co-authored-by: Mayuri Nehate <33225191+mayurinehate@users.noreply.github.com>
This commit is contained in:
David Sanchez 2023-10-27 07:01:30 +02:00 committed by GitHub
parent 1ac831f07a
commit cf617d77f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1050,8 +1050,14 @@ class BigqueryV2Source(StatefulIngestionSourceBase, TestableSource):
for idx, field in enumerate(schema_fields):
# Remove all the [version=2.0].[type=struct]. tags to get the field path
if (
re.sub(r"\[.*?\]\.", "", field.fieldPath, 0, re.MULTILINE)
== col.field_path
re.sub(
r"\[.*?\]\.",
"",
field.fieldPath.lower(),
0,
re.MULTILINE,
)
== col.field_path.lower()
):
field.description = col.comment
schema_fields[idx] = field