-
Notifications
You must be signed in to change notification settings - Fork 774
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
Pubmatic: Set bid.meta.mediaType=video when bid.ext.ibv=true #4189
base: master
Are you sure you want to change the base?
Conversation
Code coverage summaryNote:
pubmaticRefer here for heat map coverage report
|
adapters/pubmatic/pubmatictest/supplemental/bid_ext_ibv_true.json
Outdated
Show resolved
Hide resolved
Code coverage summaryNote:
pubmaticRefer here for heat map coverage report
|
Code coverage summaryNote:
pubmaticRefer here for heat map coverage report
|
Code coverage summaryNote:
pubmaticRefer here for heat map coverage report
|
Code coverage summaryNote:
pubmaticRefer here for heat map coverage report
|
@guscarreon / @scr-oath Can someone please review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please include a JSON test with no mtype
so the default banner
value gets used?
@@ -637,24 +649,27 @@ func getStringArray(array []interface{}) []string { | |||
return aString | |||
} | |||
|
|||
// getBidType returns the bid type specified in the response bid.ext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update the comment? getMediaTypeForBid
doesn't return the bid type from bid.ext
anymore.
bidType = openrtb_ext.BidTypeNative | ||
mType := openrtb_ext.BidTypeBanner | ||
if bid != nil { | ||
switch bid.MType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure from now on the media type will always be located in bid.MType
and not in bid.Ext
? Do you think we should look in bid.MType
first and then bid.Ext
second for backwards compatibility?
|
||
typedBid.BidMeta = &openrtb_ext.ExtBidPrebidMeta{MediaType: string(mType)} | ||
if bidExt.InBannerVideo { | ||
typedBid.BidMeta.MediaType = string(openrtb_ext.BidTypeVideo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the scenario where bidExt.InBannerVideo
is true
, but bidExt.VideoCreativeInfo
or bidExt.VideoCreativeInfo.Duration
is nil
, valid? If not, should we validate and append an error to the errs
array in such cases?
} | ||
if tt.expectedError != nil && actualError == nil { | ||
t.Errorf("Expected error: %v, but got nil", tt.expectedError) | ||
} else if tt.expectedError != nil && actualError != nil && actualError.Error() != tt.expectedError.Error() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if-else
statement seems to not compare an tt.expectedError
equal to nil
. If tt.expectedError
equals nil
, shouldn't we assert that actualError
is also nil
?
@@ -461,26 +462,37 @@ func (a *PubmaticAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externa | |||
bid.Cat = bid.Cat[0:1] | |||
} | |||
|
|||
mType, err := getMediaTypeForBid(&bid) | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.