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

[Ruby] Return other than @table.raw_records when saving Table to csv #15289

Closed
heronshoes opened this issue Jan 10, 2023 · 2 comments · Fixed by #33653
Closed

[Ruby] Return other than @table.raw_records when saving Table to csv #15289

heronshoes opened this issue Jan 10, 2023 · 2 comments · Fixed by #33653

Comments

@heronshoes
Copy link
Contributor

Describe the enhancement requested

Target method

Arrow::Table#save

Proposed feature

Change return value of Table#save when saving to csv files.

Current code returns @table.raw_records (Array of row Arrays). When saving a very big Table, it takes long time to display a large Array with interactive execution such as irb or Jupyter.

When we save as 'arrow' or 'arrows', it simply returns 'true'.

Candidates of return value:

  • true
  • self
  • size of Table

Impact of this request

It will improve the user experience of interactive execution. The return value of #save is rarely used.

Reference of this request

https://github.com/apache/arrow/blob/master/ruby/red-arrow/lib/arrow/table-saver.rb#L174-L176

Component(s)

Ruby

@kou
Copy link
Member

kou commented Jan 11, 2023

Let's use self.

@heronshoes
Copy link
Contributor Author

OK. I will create PR. Thank you.

heronshoes added a commit to heronshoes/arrow that referenced this issue Jan 13, 2023
heronshoes added a commit to heronshoes/arrow that referenced this issue Jan 13, 2023
heronshoes added a commit to heronshoes/arrow that referenced this issue Jan 14, 2023
kou pushed a commit that referenced this issue Jan 15, 2023
# Rationale for this change

Change return value of Table#save when saving Table to csv files.

# What changes are included in this PR?

Change return value to self (`@ table`).

# Are these changes tested?

Add test for saving to csv.

# Are there any user-facing changes?

Return value of Table#save is undetermined.

* Closes: #15289

Authored-by: Hirokazu SUZUKI <heronshoes877@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 11.0.0 milestone Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants