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

Replace column fixes #1048

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Replace column fixes #1048

wants to merge 8 commits into from

Conversation

wm75
Copy link
Collaborator

@wm75 wm75 commented Dec 10, 2020

  • The tool would previously behave unexpectedly with empty columns at the end of lines (drop columns, retain lines that should be skipped, etc)
  • The input datatype is now preserved on output
  • The code has also been cleaned a bit

wm75 added 4 commits December 10, 2020 16:37
Stripping all whitespace from the end of input lines is questionable in
general, and outright wrong in the case of tab-delimited data with empty
columns at the end of lines.
if len(out) == len(line_content):
output.write('%s\n' % delimiter_local.join(out))
if column >= len(line_content):
continue
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is somewhat questionable, but preserves the behavior of the previous version.

Copy link
Owner

Choose a reason for hiding this comment

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

we could fail instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's the simple alternative. We could also couple the behavior for short lines to the general mode (skip/error/pass), which would also not be too complicated to do.
I was just reluctant to change this cause it may force people to revise WFs when they update to the new tool version.
But if you think it's worth it I can change it to either of the two behaviors above.

Copy link
Owner

Choose a reason for hiding this comment

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

if we bump the version I think this is fine and afaik the supplied value, if this fails, is invalid

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I'll change this. Regarding to what:
I can see use-cases for the more complex implementation where users would want to skip/keep unmodified truncated lines instead of erroring out (like certain lines of the input lacking an annotation so there's nothing to replace, but you don't want to lose these lines either) so I'd prefer being able to handle such situations.

@bgruening
Copy link
Owner

I'm not sure why, but in containers, those tests all fail.

@wm75
Copy link
Collaborator Author

wm75 commented Dec 11, 2020

Yes, but it seems that job execution as such is broken.

@simonbray simonbray mentioned this pull request Dec 12, 2020
@bgruening
Copy link
Owner

Rerunning tests now.

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.

2 participants