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

Added handling for v3 advanced segment ids which aren't just ints as of July 15th #5271

Merged
merged 1 commit into from
Oct 22, 2013

Conversation

jcbozonier
Copy link
Contributor

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

@jreback
Copy link
Contributor

jreback commented Oct 19, 2013

pls put these tests in the existing test_ga.py file
pls hook up Travis (see contributing.md)

@jcbozonier
Copy link
Contributor Author

Ok. Updated tests... will check on Travis.

@jcbozonier
Copy link
Contributor Author

OK. Travis build passed as well.

@jtratner
Copy link
Contributor

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

@jcbozonier
Copy link
Contributor Author

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.

@jtratner
Copy link
Contributor

Don't need a new PR, just squash and do git push --force

@jcbozonier
Copy link
Contributor Author

Ok. All set!

@jtratner
Copy link
Contributor

@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 git commit --amend -C HEAD (amends your previous commit and keeps message) and push one more time, then I'll merge.

@jreback
Copy link
Contributor

jreback commented Oct 21, 2013

as an aside if you would like to they the exception messages when deps are not present and make a bit nicer

@jcbozonier
Copy link
Contributor Author

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.

@jtratner
Copy link
Contributor

compatible exception is just:

raise ExceptionName("My error message"), whereas <= 2.6 syntax was raise ExceptionName, "error message". Is that what you mean?

@jtratner
Copy link
Contributor

the former version is 2.6 - 3.X compatible

@jcbozonier
Copy link
Contributor Author

Yeah I think so.

@jcbozonier
Copy link
Contributor Author

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.
Copy link
Contributor

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.

@jtratner
Copy link
Contributor

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.

@jcbozonier
Copy link
Contributor Author

I'm fine with adding that. To clarify, you mean to the split test file, right?

@jcbozonier
Copy link
Contributor Author

err unit test*

@jtratner
Copy link
Contributor

No - I think @jreback meant in the read_ga() method

@jtratner
Copy link
Contributor

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.
@jcbozonier
Copy link
Contributor Author

Rebase done.

jtratner added a commit that referenced this pull request Oct 22, 2013
Added handling for v3 advanced segment ids which aren't just ints as of July 15th
@jtratner jtratner merged commit a9778f1 into pandas-dev:master Oct 22, 2013
@jtratner
Copy link
Contributor

Thanks!

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.

3 participants