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

add enum-like options to qsv fill #1887

Open
tmtmtmtm opened this issue Jun 17, 2024 · 4 comments
Open

add enum-like options to qsv fill #1887

tmtmtmtm opened this issue Jun 17, 2024 · 4 comments

Comments

@tmtmtmtm
Copy link
Contributor

I have a CSV file with an ID column created with qsv enum. Currently, unless I'm missing an obvious route, when I add additional rows to the file later, it's quite complicated to get them to also follow this ID pattern. (I have a similar issue with one with a qsv enum --uuid column, though that's easier to generate out-of-band.)

Perhaps one way to make this simpler might be to allow qsv fill to also take these incrementing-enum and uuid options, rather than only a constant value? Or is there a simpler approach here that I'm not thinking of?

@jqnatividad
Copy link
Owner

Perhaps, the best way to "fix" this is to implement a new option to enum to --overwrite-index where enum will not create a new index/id column, but overwrite it instead?

In this way, with the upcoming --hash option (#1888), you can fill then recalc the id with enum --hash?

WDYT @tmtmtmtm ?

@tmtmtmtm
Copy link
Contributor Author

You mean it would essentially just drop the existing column and then create a replacement one from scratch? Or that it would keep existing values and fill any gaps?

I don't think the first would really be useful for any case I'm dealing with at the moment (--hash will definitely help for future uses, but migrating existing data to that is going to take time, and I'm not sure yet if it'll be the best approach in all cases, or whether I'll still want some with numeric IDs), but if you mean the second, then that would be superb.

@jqnatividad
Copy link
Owner

Hi @tmtmtmtm ,
With the new deterministic --hash option in enum, I believe we don't need to extend fill with similar incrementing-enum and uuid options...

Can you confirm?

@tmtmtmtm
Copy link
Contributor Author

Hi @jqnatividad. I'm not sure yet, and it's probably going to take a while of playing with enum --hash to know how easily I can migrate the existing approaches over to that. Do you have an expected release date for that yet?

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

No branches or pull requests

2 participants