-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Make os.linesep default line_terminator in to_clipboard #13125
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
tests are in the obvious location: https://github.com/pydata/pandas/blob/master/pandas/io/tests/test_clipboard.py pls add tests. |
Have no time today. will add asap |
Current coverage is 84.11% (diff: 80.00%)@@ master #13125 diff @@
==========================================
Files 140 138 -2
Lines 50563 50388 -175
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 43103 42386 -717
- Misses 7460 8002 +542
Partials 0 0
|
|
elif isinstance(obj, DataFrame): | ||
if 'sep' in kwargs: | ||
if kwargs['sep']: | ||
raise ValueError("sep kw is unsupported with excel=False") |
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.
maybe i should remove ValueError
here? just delete sep
kw (if it's None
) for backwards compatibility. And let to_string
to raise error otherwise.
can you rebase / update? |
I'll look into it on monday. |
Add line_terminator kw to Series.to_csv Refactor to_clipboard Observed problems in to_clipboard: * try..except: pass * excel=None, though it defaults to True * several code paths with return * sep argument could be passed via kwargs * "other keywords are passed to to_csv" only if excel=True * line_terminator kw isn't supported by Series to_csv (+1 squashed commits) Squashed commits: [813f1fc] Make os.linesep default line_terminator in to_clipboard Add line_terminator kw to Series.to_csv Refactor to_clipboard Observed problems in to_clipboard: * try..except: pass * excel=None, though it defaults to True * several code paths with return * sep argument could be passed via kwargs * "other keywords are passed to to_csv" only if excel=True * line_terminator kw isn't supported by Series to_csv
255895f
to
8009746
Compare
Rebased. |
@@ -80,6 +82,14 @@ def test_round_trip_frame(self): | |||
for dt in self.data_types: | |||
self.check_round_trip_frame(dt) | |||
|
|||
def test_linesep(self): | |||
pd.DataFrame().to_clipboard() |
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.
need a fair amount more tests. these need to exercise all of the paths that are defined above.
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 mean check all self.data
dataframes? But again i don't understand, we need to check only line separator. Why test dataframes with different data?
same comment as on the issue. 4a1a330 updated the vendored pyperclip. is this PR still relevant? |
closing, but if you want to update / respond we can reopen |
closes #11720
Observed/fixed problems in to_clipboard:
Is it ok to to change Series.to_csv api?
Also we need tests, right? But what does
# pragma: no cover
mean?