Skip to content

CLN/BUG/TST: Fix and test multiple places using undefined names. #5045

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

Closed
wants to merge 9 commits into from

Conversation

jtratner
Copy link
Contributor

Pyflakes revealed that there are a number of places using undefined
names. I've tried to fix them where I can; however, those parts of the
code are also clearly untested (or tested with
assertRaises(Exception,...)) so they need some love.

The PyTables code had a bunch of places with undefined TermValue, as
did stats/misc.

Finally, I've also noted (or removed) various places where variables
were assigned but then not used.

cc @jreback

@@ -893,7 +888,7 @@ def _has_valid_type(self, key, axis):
return True

else:

# TODO: Figure out why this is unused, should it be returned?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will raise if necessary, otherwise its ok

@jreback
Copy link
Contributor

jreback commented Oct 3, 2013

@jtratner when you have a chance rebase this....and can put it in

@jtratner
Copy link
Contributor Author

jtratner commented Oct 3, 2013

Well, the main goal here was to point out where we don't have test coverage
(and could even be unreachable code, depending on how long the code has
been around). Going to see which areas are fixed after rebasing and which
still need to be fixed.

@@ -170,10 +171,10 @@ def _align_core(terms):

return typ, _zip_axes_from_type(typ, axes)


# TODO: Add tests that cover this function!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpcloud this function is never used in any tests, is it necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not ... i'll add it to the unused codepaths issue

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

@jtratner looks ok to put in...?

@jtratner
Copy link
Contributor Author

I don't expect this PR to be merged, goal was to find places where there's untested code (so eventually everything here should be addressed separately). I recall waiting to hear back on the date start/stop stuff, I'll take another look and see. You covered the pytables elements already, which is good.

@jtratner
Copy link
Contributor Author

Actually can you check that all the pytables code referenced with comments, (i.e., the TODOs or not used parts) are either removed or now have tests in master? Last I checked, the issues with data and self.data being wrong still weren't fixed. And we really need to add tests that hit those branches (and then fail because of the NameErrors)

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

@jtratner so....let's just move to 0.14...(or you can create an issue to remind to do this kind of analysis )

@jtratner
Copy link
Contributor Author

If they're legacy code, then I guess we can just fix the NameErrors (didn't
realize that was what was going on) and move on. That said, unless we
introduced those changes since v0.12, no one is using those branches.
On Oct 11, 2013 8:28 AM, "jreback" notifications@github.com wrote:

@jtratner https://github.com/jtratner so....let's just move to
0.14...(or you can create an issue to remind to do this kind of analysis )


Reply to this email directly or view it on GitHubhttps://github.com//pull/5045#issuecomment-26133245
.

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

yep....it was actually pretty tricky to come up with a case where the original code failed...you actually have to reset the timezone in python to do it. Bottom line is that these guys are using datetime.date which is pretty much unsupported, so wasn't a big deal.

@jtratner
Copy link
Contributor Author

Okay, sounds good. A couple more things that need fixing and I'll take a
look and ping the appropriate people :)

Maybe leave a note on the tests that they're testing deprecated behavior
and can be removed after some version you specify?

@jreback
Copy link
Contributor

jreback commented Oct 11, 2013

well..its not really deprecated per se, just generated differently in current version that prior version (in theory I should actually bump the version number of the generated HDFStore files, but since it can be handled both ways its not necessary)

@jreback
Copy link
Contributor

jreback commented Oct 14, 2013

@jtratner anything left on this?

* Add TODOs to places that are clearly not tested (b/c they had undefined names) and fix the undefined names
* Add TODOs to unused names.
Does not appear to ever have been used, even when class was first
created. Not sure what it was meant to be for.
@jreback
Copy link
Contributor

jreback commented Oct 23, 2013

@jtratner ?

@jreback
Copy link
Contributor

jreback commented Jan 3, 2014

@jtratner ?

@jtratner
Copy link
Contributor Author

jtratner commented Jan 3, 2014

at this point, I'm assuming this can be closed.

@jreback
Copy link
Contributor

jreback commented Jan 3, 2014

ok...

@jreback jreback closed this Jan 3, 2014
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