-
Notifications
You must be signed in to change notification settings - Fork 216
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
stdlib: Update signature of CSV.read #2002
Conversation
* It takes an IO object as `path` argument * It returns CSV::Table object when headers option given refs: * https://docs.ruby-lang.org/en/3.3/CSV.html#method-c-read * https://docs.ruby-lang.org/en/3.3/CSV.html#class-CSV-label-Option+headers
@@ -2031,7 +2031,8 @@ class CSV < Object | |||
# File.write(path, string) | |||
# CSV.read(path, headers: true) # => #<CSV::Table mode:col_or_row row_count:4> | |||
# | |||
def self.read: (String path, ?::Hash[Symbol, untyped] options) -> ::Array[::Array[String?]] | |||
def self.read: (String | IO path, headers: true | :first_row | Array[untyped] | String, **untyped options) -> ::CSV::Table[CSV::Row] |
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.
I'm not sure what is the best to type args for CSV::Table. Please let me know if there is a more appropriated one.
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.
Looks like the type parameter is not used...
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.
Thanks!
stdlib: Update signature of CSV.read
Thanks! |
path
argumentrefs: