Skip to content

Fix golang feature extraction - #11

Open
kchiang6997 wants to merge 1 commit into
IABTechLab:mainfrom
kchiang6997:main
Open

Fix golang feature extraction#11
kchiang6997 wants to merge 1 commit into
IABTechLab:mainfrom
kchiang6997:main

Conversation

@kchiang6997

Copy link
Copy Markdown
Collaborator
  • fix feature extraction behavior deviation where extracting non-wildcard json path led to empty list rather than singleton list with empty string
  • use ojg for standard jsonpath support

In the previous version, if the request did not have an app object, the returned feature extraction would be an empty list. However, this meant that the transformations would return an empty value rather than map to the "site" value, so a tuple could not be generated to look up in the cache.

Verification with sample raw request to test:

OpenRtbRequestId:e0371864-238f-41b1-a544-59b4b6a602ec TrafficAllocationContext:0x1400035a120 ModelEvaluatorOutputs:[] AggregatedModelEvaluationResult:<nil> Errors:[] DebugMessages:[]} Status:SUCCESS ModelResult:{Value:0 Key:site|banner|537144493|USA|300x250|a|4 Keys:[site|banner|537144493|USA|300x250|a|4] Values:[0]} ModelDefinition:{Identifier:adsp_low-value_v2 Name:low-value Dsp:adsp Version:v2 Type:LowValue ModelFormat: S3PathMode: FeatureExtractorType:JsonExtractor Features:[{Name:isMobile Fields:[$.app] Transformations:[Exists ApplyMappings] Mapping:map[0:site 1:app] MappingDefaultValue:} {Name:isVideo Fields:[$.imp[0].video] Transformations:[Exists ApplyMappings] Mapping:map[0:banner 1:video] MappingDefaultValue:} {Name:publisherId Fields:[$.site.publisher.id $.app.publisher.id] Transformations:[GetFirstNotEmpty] Mapping:map[] MappingDefaultValue:} {Name:country Fields:[$.device.geo.country] Transformations:[] Mapping:map[] MappingDefaultValue:} {Name:slotSize Fields:[$.imp[0].video.w $.imp[0].video.h $.imp[0].banner.w $.imp[0].banner.h] Transformations:[ConcatenateByPair GetFirstNotEmpty] Mapping:map[] MappingDefaultValue:} {Name:slotPosition Fields:[$.imp[0].video.pos $.imp[0].banner.pos] Transformations:[GetFirstNotEmpty ApplyMappings] Mapping:map[1:a 3:b 4:a 7:a] MappingDefaultValue:u} {Name:deviceType Fields:[$.device.devicetype] Transformations:[GetFirstNotEmpty ApplyMappings] Mapping:map[1:5 2:2 3:3 4:4 5:5 6:6 7:7 8:8] MappingDefaultValue:0}]} ModelFeatures:[{Configuration:0x14000042fc0 Values:[site]} {Configuration:0x14000043020 Values:[banner]} {Configuration:0x14000043080 Values:[537144493]} {Configuration:0x140000430e0 Values:[USA]} {Configuration:0x14000043140 Values:[300x250]} {Configuration:0x140000431a0 Values:[a]} {Configuration:0x14000043200 Values:[4]}]}

Final result:

{"level":"debug","library":"demand-driven-traffic-evaluator","component":"repository","component":"modelfeature","component":"bloomfilter","time":"2026-08-27T16:39:46-07:00","message":"ConfigurableAggregator evaluateNode result: score=0.000000"}
{"level":"debug","library":"demand-driven-traffic-evaluator","component":"repository","component":"modelfeature","component":"bloomfilter","time":"2026-08-27T16:39:46-07:00","message":"ConfigurableAggregator output: score=0.000000, scoreWithTreatment=0.000000, treatmentCode=T"}
&{Response:{Slots:[{FilterDecision:0 Ext:{"amazontest":{"decision":0}}}] Ext:{"amazontest":{"learning":0}}}}

…rd json path led to empty list rather than singleton list with empty string; use ojg for standard jsonpath support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant