Skip to content

MNT: Change placeholder character to control character#258

Merged
adrinjalali merged 4 commits intoskops-dev:mainfrom
E-Aho:MNT-change-placeholder-string-for-cards
Dec 19, 2022
Merged

MNT: Change placeholder character to control character#258
adrinjalali merged 4 commits intoskops-dev:mainfrom
E-Aho:MNT-change-placeholder-string-for-cards

Conversation

@E-Aho
Copy link
Copy Markdown
Collaborator

@E-Aho E-Aho commented Dec 17, 2022

Small change that swaps from using an arbitrary string of real world characters to a unicode control character.

This should reduce the risk of bugs (e.g, the original code would cause bugs if a user decided to use '$%!?' in their model card subsection or table), and the unit seperator feels a good fit for this use case.

@E-Aho E-Aho requested a review from BenjaminBossan December 17, 2022 21:06
Copy link
Copy Markdown
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

Comment thread skops/card/_model_card.py Outdated
Copy link
Copy Markdown
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Correct me if I'm wrong, this change wouldn't make a bug completely impossible, just (even more) unlikely. If so, I'm happy with the change.

@E-Aho
Copy link
Copy Markdown
Collaborator Author

E-Aho commented Dec 19, 2022

Correct me if I'm wrong, this change wouldn't make a bug completely impossible, just (even more) unlikely. If so, I'm happy with the change.

You're correct. If a user tried to pass in ASCII control characters into their table names, it would perform differently from how they expect.
But a user trying to add control characters is much less likely than using the previous punctuation imo

@adrinjalali adrinjalali merged commit 45b5972 into skops-dev:main Dec 19, 2022
@E-Aho E-Aho deleted the MNT-change-placeholder-string-for-cards branch December 19, 2022 13:24
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