Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

rashidsp
Copy link
Contributor

@rashidsp rashidsp commented Jul 4, 2018

No description provided.

@coveralls
Copy link

coveralls commented Jul 4, 2018

Coverage Status

Coverage increased (+0.004%) to 99.665% when pulling 64c5f2f on rashid/parse-revenue-value into 84736de on master.

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a 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?

@rashidsp
Copy link
Contributor Author

@aliabbasrizvi To accept 4.0 and '4.0' as valid input rather than only int(4)
View optimizely/php-sdk#91
And integrated logger to log validation messages.

return None

if not isinstance(raw_value, numbers.Integral):
Copy link
Contributor

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.)

Copy link
Contributor

@nchilada nchilada Dec 18, 2018

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.)

Copy link
Contributor

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

Copy link
Contributor

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

@aliabbasrizvi
Copy link
Contributor

I am assuming this change is not being worked on. Going to close this. Please re-open if you feel otherwise.

@aliabbasrizvi aliabbasrizvi deleted the rashid/parse-revenue-value branch July 26, 2019 17:29
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.

None yet

5 participants