-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Change Finance Options signatures and deprecate year/month parameters #3822
Conversation
This is the error this build gets (my local unit test was running without errors ...). Investigating:
|
Why wouldn't lxml.html be available under Python 2.6?
|
Could somebody offer some comments on this? I cannot reproduce the same error locally running with/without network connectivity. |
s = "Failed to download:\n{0}".format(e) | ||
print s | ||
return None | ||
lines = urllib2.urlopen(urlStr).readlines() |
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 there a reason you are taking out this exception? This will catch a failed network download
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 reason to take out the exception
- this will make it consistent with the behaviour of the other functions (which do throw this network error)
- this allows in the unit test to mark the test "skip"
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.
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.
@jreback I would like to make this work correctly first :)
@gliptak can you rebase to a smaller num of commits? e.g
|
|
That's a nice tip! I also recommend squashing before doing a rebase (that way you do fewer steps / one step for conflicts, and more likely to understand how they can be resolved). |
@cpcloud maybe also add these tips to developer page? and It hink should have a link to developer page from somewhere in main docs...... |
there's a link...dev workflow is on my pandas to-do list: 2nd after |
#3156 :) |
@jreback I did squash several commits. Thanks |
@gliptak Right now the test cases for network errors aren't really doing what you want, because they catch all exceptions for bad tests, as opposed to specifically describing the behavior you want (e.g., should Catching exceptions with the baseclass Also, I suggest you consider changing the from pandas.core.common import PandasError
class DataError(PandasError):
pass And that way you can catch these in your test cases, etc. |
@jtratner note that in the code I'm not raising exceptions, although not catching/converting them to 'known' exceptions either. I believe the test code works, as it only marks the failing test skip if it notes a network problem (by trying to connect to google.com) The change you are suggesting is not related to this enhancement, I would be happy to work modifying current code as a separate pull request. the reason that I widened to catching as per http://stackoverflow.com/a/3465796/304690 |
I mean exceptions like this: raise Exception("after %d tries, Yahoo did not "
"return a 200 for url %s" % (pause, url)) And in test cases, when it tests |
@jtratner Jeff, that is existing code, unmodified from current HEAD. As I said above, i would be happy to continue refactoring under a new pull request. |
@@ -430,8 +425,9 @@ def _parse_options_data(table): | |||
|
|||
|
|||
class Options(object): | |||
import warnings |
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.
You should move this import statement outside of the class definition (preferably at the top of the file). Right now Options
has an attribute warnings which is this package.
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.
Done
@gliptak this needs release notes / mention in v0.11.1 |
@jreback updated RELEASE.rst |
@gliptak You're going to need to rebase again (it happens pretty often with the RELEASE.rst as everyone is adding to it) Tip: don't add your release note at the end, that way it's less likely to conflict :) |
@hayd Thanks Andy. Moved my note higher up. |
(There's no guarantee it will merge cleanly even when not at the bottom, (I claim) it just makes it less lightly - so there still could be a conflict even when moved, only way to be sure is to do the rebase :) ) |
@gliptak can you edit this after the new decorators are merged in and remove the in-test IOError checks? |
@jtratner I can work that tomorrow afternoon/evening. |
@gliptak looks like you tried to merge from upstream. i'm going to pull down ur branch and take a look |
i used to do this until i understood merge vs. rebase. going forward it's key that u understand the differences so that your contributions will be merged faster... |
ok so all you need to do is the following git fetch upstream
git rebase upstream/master
# resolve the merge conflict generated here
git add pandas/io/data.py
git rebase --continue |
i use the first 2 commands so often that i have them aliased as alias gfrb='git fetch upstream && git rebase upstream/master' |
@cpcloud fyi.....should put |
@jreback this is what i basically did, but i could not complete the rebase ... |
what do you mean you couldn't complete it? |
@jreback anything elseyou want me to add to the wiki? |
looks good...maybe a bit more about how to actually run |
@cpcloud I got: |
hm i only get git fatals when a lock file isn't removed...then usually it is when i check and then i run it again...if u get stuck on a rebase do |
@cpcloud yes, I tried. even after |
hm i pulled down ur branch just after your first message and things went except for 2 merge conflicts which were easy to resolve... |
@@ -897,11 +876,21 @@ def get_near_stock_price(self, above_below=2, call=True, put=False, | |||
else: | |||
return chop_put | |||
|
|||
def _try_parse_dates(self, year, month, expiry): | |||
if (year is not None or month is not None): |
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.
don't need to change this but fyi there's no need for the parens, they are implicit
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.
done :)
@gliptak looks ready to go? |
@jreback I think so |
Change Finance Options signatures and deprecate year/month parameters
thank you |
can you have a look? test_options keeps failing sometimes.. |
#3817