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

fix(enrich): unwantedly replacing data #209

Merged
merged 2 commits into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/extractors/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ func (e *Extractor) Extract(ctx context.Context, config map[string]interface{},
return
}

// Fetch and iterate over datesets
// Fetch and iterate over datasets
it := e.client.Datasets(ctx)
for {
ds, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
return errors.Wrap(err, "failed to fetch dataset")
return errors.Wrapf(err, "failed to fetch dataset %s", ds.DatasetID)
}
e.extractTable(ctx, ds, out)
}
Expand All @@ -123,12 +123,12 @@ func (e *Extractor) extractTable(ctx context.Context, ds *bigquery.Dataset, out
break
}
if err != nil {
e.logger.Error("failed to scan, skipping table", "err", err)
e.logger.Error("failed to scan, skipping table", "err", err, "table", table.FullyQualifiedName())
continue
}
tmd, err := table.Metadata(ctx)
if err != nil {
e.logger.Error("failed to fetch table's metadata, skipping table", "err", err)
e.logger.Error("failed to fetch table's metadata, skipping table", "err", err, "table", table.FullyQualifiedName())
continue
}

Expand Down
6 changes: 3 additions & 3 deletions utils/custom_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func SetCustomProperties(data interface{}, customFields map[string]interface{})
case assets.Table:
data.Properties = createOrGetCustomFacet(data.Properties)
data.Properties.Attributes = protoStruct
res = data.Properties
res = data
case assets.Topic:
data.Properties = createOrGetCustomFacet(data.Properties)
data.Properties.Attributes = protoStruct
res = data.Properties
res = data
case assets.Dashboard:
data.Properties = createOrGetCustomFacet(data.Properties)
data.Properties.Attributes = protoStruct
res = data.Properties
res = data
default:
res = data
}
Expand Down