-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
add "fixed-column" option #81
Conversation
For colname:value, add a column colname and populate with value
I like this as a feature. I'd prefer it to use the following syntax though, rather than implementing its own split on the
Here's an example of an option in The syntax for the decorator would look like this: @click.option(
"--fixed-column",
multiple=True,
type=(str, str),
help="Populate column with a fixed value",
) |
Realizing that casting the values as float or int probably isn't necessary. |
I integrated the changes above and updated test_fixed_column to test all three options.
This didn't work for a date column though: And the reason is a little confusing: |
This looks great to me - I'll merge this in the morning! |
For colname:value, add a column colname and populate with value.
The use case here is that I have a snakemake workflow that produces a lot of csv files with a structure like:
samples/<sample_id>/<condition_name>/this.csv
I want to import them all into the same table, where
sample_id
andcondition_name
are columns. I tried to match how--filename_column
works, but allow for multiple new columns to be added.I haven't yet added any tests, but if you think this option would be a useful addition, I will add some tests to cover the basic use case and the combination with shape.