-
Notifications
You must be signed in to change notification settings - Fork 23
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
Strip out all special characters from csv headers #915
Conversation
…. Today is the day
…inate with ajax updates
…at generators work
…d unicode items, including the unicode bom, laying around. This causes havic. By stopping it right from the start we should prevent saving invisible characters to raw_metadata and other places they get stuck
ea238d6
to
1adeff0
Compare
def self.read_data(path) | ||
raise StandardError, 'CSV path empty' if path.blank? | ||
options = { | ||
headers: true, | ||
header_converters: ->(h) { h.to_s.strip.to_sym }, | ||
header_converters: ->(h) { h.to_s.gsub(/[^\w\d -]+/, '').strip.to_sym }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want underscore as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremyf \w includes underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I (re-)learned!
* main: Denormalize Status Message to that Entry Look Up Can Be Fast (#913) ⚙️ Adding dry-monads as development dependency
closing this one for #918 instead as it is a cleaner PR |
These cause nothing but pain.