Skip to content

Commit

Permalink
pass JITSU_TABLE_NAME parameter to sources transformation object
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Mar 21, 2023
1 parent 03fae76 commit 81689a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ configurator/backend/openapi/*

configurator/build/*
server/venv
server/airbyte_config
2 changes: 1 addition & 1 deletion server/appconfig/appconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func setDefaultParams(containerized bool) {

viper.SetDefault("sync-tasks.log.enabled", true)
viper.SetDefault("sync-tasks.log.path", logging.GlobalType)
viper.SetDefault("sync-tasks.store_attempts", 3)
viper.SetDefault("sync-tasks.store_attempts", 2)

//User Recognition anonymous events default TTL 10080 min - 7 days
viper.SetDefault("meta.storage.redis.ttl_minutes.anonymous_events", 10080)
Expand Down
2 changes: 2 additions & 0 deletions server/schema/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func (p *Processor) ProcessPulledEvents(tableName string, objects []map[string]i
}
var transformed map[string]interface{}
if p.transformer != nil && (p.transformSourcesAllowed || viper.GetBool("experimental.source_transform_enabled")) {
processedObject[templates.TableNameParameter] = tableName
rawTransformed, err := p.transformer.ProcessEvent(processedObject, nil)
if err != nil {
metrics.TransformErrors(p.identifier)
Expand All @@ -210,6 +211,7 @@ func (p *Processor) ProcessPulledEvents(tableName string, objects []map[string]i
if !ok {
return nil, fmt.Errorf("failed to apply javascript transform: result type %T is not an object.", rawTransformed)
}
delete(transformed, templates.TableNameParameter)
} else {
transformed = processedObject
}
Expand Down

0 comments on commit 81689a8

Please sign in to comment.