-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
… a new supplied column
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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.
Minor comments, but this looks good. Thanks for doing this work
cpp/src/arrow/util/stl.h
Outdated
const T& new_element) { | ||
DCHECK_LE(index, values.size()); | ||
std::vector<T> out; | ||
out.reserve(values.size() + 1); |
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.
Can this append at the end? If not then remove the + 1
here
python/pyarrow/tests/test_table.py
Outdated
col = pa.Column.from_array('d', data[1]) | ||
t2 = table.set_column(0, col) | ||
|
||
expected_data = copy.copy(data) |
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.
Can also use list
@@ -635,6 +635,30 @@ cdef class Schema: | |||
|
|||
return pyarrow_wrap_schema(new_schema) | |||
|
|||
def set(self, int i, Field field): |
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.
set_field
for nominal consistency?
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 have sticked to set
as we also have simply remove
and insert
on the Schema.
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.
👍
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.
+1
No description provided.