-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Added handling for v3 advanced segment ids which aren't just ints as of July 15th #5271
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
Conversation
pls put these tests in the existing test_ga.py file |
Ok. Updated tests... will check on Travis. |
OK. Travis build passed as well. |
Can you this down to one commit and rebase on master? Also, does this break v2 support? (or is v2 no longer supported by Google?) |
Sure! How can I do the squash given the current state of my branch? Do I need to issue a new pull request? As far as v2 goes this does not break v2 support. There are unit tests to support those cases as well in my code. |
Don't need a new PR, just squash and do git push --force |
Ok. All set! |
@jcbozonier one last thing - can you add a note to doc/source/release.rst that says you added support for v3 segment ids for GA? And then just do |
as an aside if you would like to they the exception messages when deps are not present and make a bit nicer |
Added a note. Also, I wanted to add a nicer exception but I wasn't sure how to do it in a way that was 2.6 AND 3.2 compatible. The next enhancement I make I'll take another stab at it. |
compatible exception is just:
|
the former version is 2.6 - 3.X compatible |
Yeah I think so. |
Does it make more sense just to let it blow? Why even catch those exceptions? |
@@ -86,6 +86,7 @@ Experimental Features | |||
Improvements to existing features | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
- Added support for Google Analytics v3 API segment IDs that also supports v2 IDs. |
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 you move this to the end of the section (b/c it's pretty much chronological) and add (:issue:'5271')
to the end [but replace single quote with backticks], that'll make it end up with a link to this issue in the docs so someone who cares can find out more.
it's basically just something like: try:
import <your dep>
except ImportError as e:
raise ImportError("read_ga requires Google's ga package: %s" % str(e)) Your call - I'm +1 if you want to add a nice error message but I'll merge this after you make that slight to change to the docs note if you don't want to add it. |
I'm fine with adding that. To clarify, you mean to the split test file, right? |
err unit test* |
No - I think @jreback meant in the |
I guess you'll need to rebase this - apparently there's a merge conflict with something else (probably another PR that was merged in the interim) |
The old int based advanced segment ids are deprecated. The new segment ids are alphanumeric. I know from experimentation that their form includes alphanumeric and alphanumeric+hyphen. Updated code for both cases. Consolidated tests and fixed broken references In consolidating my test file with the preexisting GA test file, I found a broken dependency to reset_token_store. It looks like it was renamed to reset_default_token_store so I updated this file to point to that. Also added tests around formatting of segment ids to the GA query to this file. **CLN** Removed debugging code I added.
Rebase done. |
Added handling for v3 advanced segment ids which aren't just ints as of July 15th
Thanks! |
The old int based advanced segment ids are deprecated. The new segment ids are alphanumeric. I know from experimentation that their form includes alphanumeric and alphanumeric+hyphen. Updated code for both
cases. Reference: https://developers.google.com/analytics/devguides/reporting/core/v3/changelog