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

stdlib: Update signature of CSV.read #2002

Merged
merged 1 commit into from
Sep 13, 2024
Merged

stdlib: Update signature of CSV.read #2002

merged 1 commit into from
Sep 13, 2024

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Sep 11, 2024

  • It takes an IO object as path argument
  • It returns CSV::Table object when headers option given

refs:

* 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]
Copy link
Contributor Author

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.

Copy link
Member

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...

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thanks!

@soutaro soutaro added this pull request to the merge queue Sep 13, 2024
@soutaro soutaro added this to the RBS 3.6 milestone Sep 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 13, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 13, 2024
stdlib: Update signature of CSV.read
@soutaro soutaro added this pull request to the merge queue Sep 13, 2024
Merged via the queue into ruby:master with commit 102d95c Sep 13, 2024
19 checks passed
@tk0miya tk0miya deleted the csv_read branch September 13, 2024 13:43
@tk0miya
Copy link
Contributor Author

tk0miya commented Sep 13, 2024

Thanks!

@soutaro soutaro added the Released PRs already included in the released version label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

2 participants