-
Notifications
You must be signed in to change notification settings - Fork 35
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
Parses revenue value and logger integration #134
Conversation
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.
This looks like a big change. Can you give more information why this is needed?
@aliabbasrizvi To accept 4.0 and '4.0' as valid input rather than only int(4) |
return None | ||
|
||
if not isinstance(raw_value, numbers.Integral): |
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.
This restriction exists because the revenue
field, unlike value
, can only take on integral values when tracked to Optimizely's events endpoint. So if we accept other types, we'd have to only drop all values that can't be converted to integers.
Given that, and given the fact that APIs can't be narrowed once broadened, I'd err on the side of closing this PR. 😕
(Regarding the size limits that we're introducing in #151: internal documentation leads me to believe that the revenue
field can be rather large. But I'm not sure since it's not well-documented. I'd say we don't need to worry about these size limits for now.)
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.
(Oops, @aliabbasrizvi did suggest that we apply a size limit to the revenue
field and its companions. Let's follow up in the context of #151, the PR for size limiting.)
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.
@mikeng13 Can you please give your input on this? We already have revenue value parsing implemented in PHP and Ruby. optimizely/php-sdk#91.
Please note that 4.1 is not accepted as a valid revenue value while 4.0, "4", "4.0" are valid.
Javascript is parsing 13 from 13.37. https://github.com/optimizely/javascript-sdk/blob/master/packages/optimizely-sdk/lib/utils/event_tag_utils/index.tests.js#L46
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.
@oakbani oh, interesting, I didn't know that other SDKs already do some kind of advanced parsing. Seems okay if we accept a consistent set of string formats and if we ignore non-integer values.
@mikeng13 @ceimaj can you all follow up here? TL;DR we need to figure out how to parse revenue across our SDKs
I am assuming this change is not being worked on. Going to close this. Please re-open if you feel otherwise. |
No description provided.