Skip to content

Commit 818e51b

Browse files
Merge pull request #670 from bruin-data/TanayBensuYurtturk/hubspot-licenses-associations-null
fix custom object associations
2 parents ad5906a + eee7663 commit 818e51b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pkg/source/hubspot/hubspot.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ func (s *Hubspotsource) readCustomObject(ctx context.Context, table string, opts
10061006
startMs = fmt.Sprintf("%d", epochStart.UnixMilli())
10071007
}
10081008

1009-
return s.searchCRMObjects(ctx, objectName, cfg, properties, startMs, opts, results)
1009+
return s.searchCRMObjects(ctx, cfg, properties, startMs, opts, results)
10101010
}
10111011

10121012
func (s *Hubspotsource) readCustomObjectHistory(ctx context.Context, table string, historyProps []string, opts source.ReadOptions, results chan<- source.RecordBatchResult) error {
@@ -1072,7 +1072,7 @@ func (s *Hubspotsource) readCRMObjects(ctx context.Context, tableName string, hi
10721072
return s.searchCRMObjectsHistory(ctx, cfg, properties, startMs, opts, results)
10731073
}
10741074

1075-
if err := s.searchCRMObjects(ctx, tableName, cfg, properties, startMs, opts, results); err != nil {
1075+
if err := s.searchCRMObjects(ctx, cfg, properties, startMs, opts, results); err != nil {
10761076
return err
10771077
}
10781078

@@ -1086,7 +1086,7 @@ func timeToMs(val *time.Time) string {
10861086
return fmt.Sprintf("%d", val.UnixMilli())
10871087
}
10881088

1089-
func (s *Hubspotsource) searchCRMObjects(ctx context.Context, pluralType string, cfg tableConfig, properties []string, startDateMs string, opts source.ReadOptions, results chan<- source.RecordBatchResult) error {
1089+
func (s *Hubspotsource) searchCRMObjects(ctx context.Context, cfg tableConfig, properties []string, startDateMs string, opts source.ReadOptions, results chan<- source.RecordBatchResult) error {
10901090
endpoint := fmt.Sprintf("crm/v3/objects/%s/search", cfg.ObjectType)
10911091
totalProcessed := 0
10921092
endMs := timeToMs(opts.IntervalEnd)
@@ -1186,9 +1186,9 @@ func (s *Hubspotsource) searchCRMObjects(ctx context.Context, pluralType string,
11861186
wg.Add(1)
11871187
go func(at string) {
11881188
defer wg.Done()
1189-
am, err := s.fetchAssociationsBatch(ctx, pluralType, at, objIDs)
1189+
am, err := s.fetchAssociationsBatch(ctx, cfg.ObjectType, at, objIDs)
11901190
if err != nil {
1191-
config.Debug("[HUBSPOT] Failed to fetch associations %s->%s: %v", pluralType, at, err)
1191+
config.Debug("[HUBSPOT] Failed to fetch associations %s->%s: %v", cfg.ObjectType, at, err)
11921192
return
11931193
}
11941194
assocCh <- assocResult{assocType: at, assocMap: am}

0 commit comments

Comments
 (0)