-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix for DateOffset's reprs. (GH4638) #4868
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
can you show some examples of the before and after? (in the top of this PR) |
@jreback Added some examples of before and after |
Would it be easy to make eval(repr(offset)) work? It looks like it would be simple to do. Makes life easier/cleaner. |
I suppose this could be done by:
Item 3 is the most complicated in the list. |
Okay, sounds like it's not simple. What you have is fine, though I don't |
That is the
|
Even if I don't make the repr work with eval, There might be some tweak I am thinking of not printing n if it's 1, and inserting the times operator Thoughts?
|
can you add some test for evaling the repr? |
Honestly, if it's understandable to you and @jreback, it's probably fine. |
@jreback I am not planning on having the I am just suggesting cleaning up the format a bit. For example, the new after:
|
ok...this looks fine...pls rebase and squash |
@jreback I still have to make the final change to formatting |
@jreback Should be good to merge. |
@@ -741,7 +757,6 @@ def __init__(self, n=1, **kwds): | |||
self.n = n | |||
self.startingMonth = kwds.get('startingMonth', 3) | |||
|
|||
self.offset = BMonthEnd(3) |
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.
what replaced this?
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.
This line did nothing. self.offset
is never read
Can you rebase this? Not mergeable right now. |
Is there an easy way to tell in Github that I need to do a rebase? |
Not really - committers can see it. You can tell in git...just try to either (1) rebase on top of master or (2) merge with master. In general, it's helpful if you just periodically rebase and push (since it keeps the history nicer). If there are no merge conflicts, you don't have to do anything. If there are merge conflicts, we'd be asking you to rebase anyways, so you'll have to deal with them eventually regardless... |
looks like there are merge conflicts fyi |
ping! |
@cancan101 need to rebase |
Okay. Rebased |
@@ -247,7 +259,7 @@ def __init__(self, n=1, **kwds): | |||
def rule_code(self): | |||
return 'B' | |||
|
|||
def __repr__(self): | |||
def __repr__(self): #TODO: Figure out if this should be merged into DateOffset |
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 this actually still a TODO?
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.
@cancan101 all I mean is that presumably you'd be making this decision now - right? Otherwise I'll merge.
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.
Yes. I have to take a look to figure out why some/all of the repr code was duplicated here.
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.
I saw what looked like code duplication but did not have the time to look into it.
BUG: Fix for DateOffset's reprs. (GH4638)
@cancan101 thanks! |
closes #4638
Before:
after: