Skip to content

Commit

Permalink
fix(enrich): unwantedly replacing data (#209)
Browse files Browse the repository at this point in the history
* fix(enrich): unwantedly replacing data

* refactor(bigquery): add more information when logging
  • Loading branch information
StewartJingga authored Sep 12, 2021
1 parent 7159c72 commit afaa6a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit afaa6a4

Please sign in to comment.