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

More RS/ASCII updates: clearer update method #1621

Closed
wants to merge 2 commits into from
Closed

Conversation

johnkerl
Copy link
Owner

Comment on lines +46 to +53
"ascii_esc": ASCII_ESC,
"ascii_etx_char": ASCII_ETX,
"ascii_fs": ASCII_FS,
"ascii_gs": ASCII_GS,
"ascii_null_char": ASCII_NULL,
"ascii_rs": ASCII_RS,
"ascii_soh_char": ASCII_SOH,
"ascii_stx_char": ASCII_STX,

Choose a reason for hiding this comment

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

Nice! But isn't the deprecated old values mapping missing?
Something like this?

    "ascii_esc":       ASCII_ESC,
    "ascii_etx":       "\\x04",     // deprecated
    "ascii_etx_char":  ASCII_ETX,
    "ascii_fs":        ASCII_FS,
    "ascii_gs":        ASCII_GS,
    "ascii_null":      "\\x01",     // deprecated
    "ascii_null_char": ASCII_NULL,
    "ascii_rs":        ASCII_RS,
    "ascii_soh":       "\\x02",     // deprecated
    "ascii_soh_char":  ASCII_SOH,
    "ascii_stx":       "\\x03",     // deprecated
    "ascii_stx_char":  ASCII_STX,

Sorry I should make a pr but I'm using another machine and it's a bit cumbersome from this one

Copy link
Owner Author

Choose a reason for hiding this comment

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

@GlassGruber TBH I'd rather surface a hard error if someone uses an old mapping that's wrong -- then they can fix their pipelines ...

Copy link
Owner Author

@johnkerl johnkerl Aug 16, 2024

Choose a reason for hiding this comment

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

Maybe it can print a warning for the next release, then, old syntax goes away in the release after? I.e. a deprecation cycle ...

I definitely do not want to keep misnamed values around forever ..... :|

Choose a reason for hiding this comment

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

Totally makes sense!

@balki
Copy link
Contributor

balki commented Sep 25, 2024

I think for this case, it is better to break backwards compatibility and highlight clearly in ReleaseNotes. It is very unlikely for someone to use ascii_null to mean SOH. I think users would have realized the aliases don't work and replaced with explicit forms like \0 or \x00.

Renaming makes them verbose (extra _char) and inconsistent naming as some aliases don't have _char while some have.

Also the old name does not cause miller to fail but take them literally.

miller on  ascii:kerl/ascii-more via 🐹 v1.23.1 
❯ echo "foo,bar\n1,2\n3,4" |  go run cmd/mlr/main.go --c2d --ofs ascii_null cat | od -c
0000000   f   o   o   =   1   a   s   c   i   i   _   n   u   l   l   b
0000020   a   r   =   2  \n   f   o   o   =   3   a   s   c   i   i   _
0000040   n   u   l   l   b   a   r   =   4  \n
0000052

@johnkerl
Copy link
Owner Author

@balki I like that! @GlassGruber what do you think?

@GlassGruber
Copy link

I think it makes sense, especially this

It is very unlikely for someone to use ascii_null to mean SOH. I think users would have realized the aliases don't work and replaced with explicit forms like \0 or \x00.

it's just what I did!
I'm usually for taking it slow about breaking compatibility, but yea no much sense in keeping things as in current state. Also removing that extra _char is a nice +1!

@johnkerl
Copy link
Owner Author

johnkerl commented Oct 5, 2024

Thanks @balki @GlassGruber -- I'll close this & tag 6.13.0.

@johnkerl johnkerl closed this Oct 5, 2024
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.

3 participants