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

ARROW-2699: [C++/Python] Add Table method that replaces a column with a new supplied column #2140

Closed
wants to merge 2 commits into from

Conversation

xhochy
Copy link
Member

@xhochy xhochy commented Jun 14, 2018

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 14, 2018

Codecov Report

Merging #2140 into master will decrease coverage by 0.02%.
The diff coverage is 78.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2140      +/-   ##
==========================================
- Coverage   86.41%   86.39%   -0.03%     
==========================================
  Files         242      230      -12     
  Lines       41534    40701     -833     
==========================================
- Hits        35893    35162     -731     
+ Misses       5641     5539     -102
Impacted Files Coverage Δ
cpp/src/arrow/table.h 100% <ø> (ø) ⬆️
cpp/src/arrow/type.h 86.53% <ø> (ø) ⬆️
python/pyarrow/types.pxi 57.39% <0%> (-0.51%) ⬇️
python/pyarrow/tests/test_table.py 100% <100%> (ø) ⬆️
cpp/src/arrow/table-test.cc 100% <100%> (ø) ⬆️
cpp/src/arrow/table.cc 94.06% <63.63%> (-1.03%) ⬇️
python/pyarrow/table.pxi 69.05% <75%> (+0.05%) ⬆️
cpp/src/arrow/type.cc 92.41% <83.33%> (-0.21%) ⬇️
cpp/src/arrow/util/stl.h 96.66% <90%> (-3.34%) ⬇️
python/pyarrow/parquet.py 88.95% <0%> (ø) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b00b8a...95f264d. Read the comment docs.

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

Minor comments, but this looks good. Thanks for doing this work

const T& new_element) {
DCHECK_LE(index, values.size());
std::vector<T> out;
out.reserve(values.size() + 1);
Copy link
Member

Choose a reason for hiding this comment

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

Can this append at the end? If not then remove the + 1 here

col = pa.Column.from_array('d', data[1])
t2 = table.set_column(0, col)

expected_data = copy.copy(data)
Copy link
Member

Choose a reason for hiding this comment

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

Can also use list

@@ -635,6 +635,30 @@ cdef class Schema:

return pyarrow_wrap_schema(new_schema)

def set(self, int i, Field field):
Copy link
Member

Choose a reason for hiding this comment

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

set_field for nominal consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have sticked to set as we also have simply remove and insert on the Schema.

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

+1

@wesm wesm closed this in 884474c Jun 21, 2018
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