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

REPR: kwds in DateOffset #4638

Closed
cancan101 opened this issue Aug 22, 2013 · 3 comments · Fixed by #4868
Closed

REPR: kwds in DateOffset #4638

cancan101 opened this issue Aug 22, 2013 · 3 comments · Fixed by #4868
Labels
Frequency DateOffsets Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@cancan101
Copy link
Contributor

Currently the signature for constructing most DateOffset is (n, **kwds).

Optional ags are then read using get(key) from the kwds and required args using [key]. This is fine, but it leaves what was extracted from kwds still in kwds leading to a redundant str or repr:

Week(weekday=0)
<1 Week: kwds={'weekday': 0}, weekday=0>

I would recommend using pop instead of get and using del after reading required values.

Thoughts?

@jreback
Copy link
Contributor

jreback commented Aug 22, 2013

you can just try it and see if it breaks tests (use a separate branch); if it looks ok, then submit a PR

(maybe add a test for the new repr)

@cancan101
Copy link
Contributor Author

Taking a look at how kwds is used (e.g for copy) by the base class, DateOffset, it will be easier to cleanup how repr works rather than changing what is left in kwds.

@jreback
Copy link
Contributor

jreback commented Aug 22, 2013

there's prob not a lot of testing on this area of pandas....go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants