Skip to content

Commit 77f8f3c

Browse files
authored
Merge pull request #5 from apache/master
Syncing from original
2 parents bc5db7d + ed27243 commit 77f8f3c

36 files changed

+463
-257
lines changed

c_glib/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ AC_CONFIG_FILES([
143143
arrow-gpu-glib/arrow-gpu-glib.pc
144144
doc/Makefile
145145
doc/reference/Makefile
146-
doc/reference/xml/Makefile
146+
doc/reference/entities.xml
147147
example/Makefile
148148
example/lua/Makefile
149149
tool/Makefile

c_glib/doc/reference/Makefile.am

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
SUBDIRS = \
19-
xml
20-
2118
DOC_MODULE = arrow-glib
2219

2320
DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml
@@ -72,4 +69,5 @@ CLEANFILES += \
7269
$(DOC_MODULE).types
7370

7471
EXTRA_DIST += \
72+
entities.xml.in \
7573
meson.build

c_glib/doc/reference/arrow-glib-docs.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
2222
[
2323
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
24-
<!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
24+
<!ENTITY % gtkdocentities SYSTEM "entities.xml">
2525
%gtkdocentities;
2626
]>
27-
<book id="index">
27+
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
2828
<bookinfo>
2929
<title>&package_name; Reference Manual</title>
3030
<releaseinfo>

c_glib/doc/reference/xml/gtkdocentities.ent.in renamed to c_glib/doc/reference/entities.xml.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
specific language governing permissions and limitations
1717
under the License.
1818
-->
19-
<!ENTITY package "@package@">
20-
<!ENTITY package_bugreport "@package_bugreport@">
21-
<!ENTITY package_name "@package_name@">
22-
<!ENTITY package_string "@package_string@">
23-
<!ENTITY package_url "@package_url@">
24-
<!ENTITY package_version "@package_version@">
19+
<!ENTITY package "@PACKAGE@">
20+
<!ENTITY package_bugreport "@PACKAGE_BUGREPORT@">
21+
<!ENTITY package_name "@PACKAGE_NAME@">
22+
<!ENTITY package_string "@PACKAGE_STRING@">
23+
<!ENTITY package_url "@PACKAGE_URL@">
24+
<!ENTITY package_version "@PACKAGE_VERSION@">

c_glib/doc/reference/meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919

20-
subdir('xml')
20+
entities_conf = configuration_data()
21+
entities_conf.set('PACKAGE', meson.project_name())
22+
entities_conf.set('PACKAGE_BUGREPORT',
23+
'https://issues.apache.org/jira/browse/ARROW')
24+
entities_conf.set('PACKAGE_NAME', meson.project_name())
25+
entities_conf.set('PACKAGE_STRING',
26+
' '.join([meson.project_name(), version]))
27+
entities_conf.set('PACKAGE_URL', 'https://arrow.apache.org/')
28+
entities_conf.set('PACKAGE_VERSION', version)
29+
configure_file(input: 'entities.xml.in',
30+
output: 'entities.xml',
31+
configuration: entities_conf)
2132

2233
private_headers = [
2334
]

c_glib/doc/reference/xml/Makefile.am

Lines changed: 0 additions & 20 deletions
This file was deleted.

c_glib/doc/reference/xml/meson.build

Lines changed: 0 additions & 31 deletions
This file was deleted.

ci/travis_lint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ popd
3535
# Fail fast on style checks
3636
sudo pip install flake8
3737

38-
PYARROW_DIR=$TRAVIS_BUILD_DIR/python/pyarrow
38+
PYTHON_DIR=$TRAVIS_BUILD_DIR/python
3939

40-
flake8 --count $PYARROW_DIR
40+
flake8 --count $PYTHON_DIR/pyarrow
4141

4242
# Check Cython files with some checks turned off
4343
flake8 --count --config=$PYTHON_DIR/.flake8.cython \
44-
$PYARROW_DIR
44+
$PYTHON_DIR/pyarrow

cpp/src/arrow/python/numpy_to_arrow.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static Status AppendObjectBinaries(PyArrayObject* arr, PyArrayObject* mask,
175175
continue;
176176
} else if (!PyBytes_Check(obj)) {
177177
std::stringstream ss;
178-
ss << "Error converting to Python objects to bytes: ";
178+
ss << "Error converting from Python objects to bytes: ";
179179
RETURN_NOT_OK(InvalidConversion(obj, "str, bytes", &ss));
180180
return Status::Invalid(ss.str());
181181
}
@@ -230,7 +230,7 @@ static Status AppendObjectStrings(PyArrayObject* arr, PyArrayObject* mask, int64
230230
*have_bytes = true;
231231
} else {
232232
std::stringstream ss;
233-
ss << "Error converting to Python objects to String/UTF8: ";
233+
ss << "Error converting from Python objects to String/UTF8: ";
234234
RETURN_NOT_OK(InvalidConversion(obj, "str, bytes", &ss));
235235
return Status::Invalid(ss.str());
236236
}
@@ -278,7 +278,7 @@ static Status AppendObjectFixedWidthBytes(PyArrayObject* arr, PyArrayObject* mas
278278
tmp_obj.reset(obj);
279279
} else if (!PyBytes_Check(obj)) {
280280
std::stringstream ss;
281-
ss << "Error converting to Python objects to FixedSizeBinary: ";
281+
ss << "Error converting from Python objects to FixedSizeBinary: ";
282282
RETURN_NOT_OK(InvalidConversion(obj, "str, bytes", &ss));
283283
return Status::Invalid(ss.str());
284284
}

cpp/src/arrow/table-test.cc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ TEST_F(TestChunkedArray, EqualsDifferingLengths) {
108108
ASSERT_TRUE(one_->Equals(*another_.get()));
109109
}
110110

111+
TEST_F(TestChunkedArray, SliceEquals) {
112+
arrays_one_.push_back(MakeRandomArray<Int32Array>(100));
113+
arrays_one_.push_back(MakeRandomArray<Int32Array>(50));
114+
arrays_one_.push_back(MakeRandomArray<Int32Array>(50));
115+
Construct();
116+
117+
std::shared_ptr<ChunkedArray> slice = one_->Slice(125, 50);
118+
ASSERT_EQ(slice->length(), 50);
119+
ASSERT_TRUE(slice->Equals(one_->Slice(125, 50)));
120+
121+
std::shared_ptr<ChunkedArray> slice2 = one_->Slice(75)->Slice(25)->Slice(25, 50);
122+
ASSERT_EQ(slice2->length(), 50);
123+
ASSERT_TRUE(slice2->Equals(slice));
124+
}
125+
111126
class TestColumn : public TestChunkedArray {
112127
protected:
113128
void Construct() override {
@@ -158,6 +173,22 @@ TEST_F(TestColumn, ChunksInhomogeneous) {
158173
ASSERT_RAISES(Invalid, column_->ValidateData());
159174
}
160175

176+
TEST_F(TestColumn, SliceEquals) {
177+
arrays_one_.push_back(MakeRandomArray<Int32Array>(100));
178+
arrays_one_.push_back(MakeRandomArray<Int32Array>(50));
179+
arrays_one_.push_back(MakeRandomArray<Int32Array>(50));
180+
one_field_ = field("column", int32());
181+
Construct();
182+
183+
std::shared_ptr<Column> slice = one_col_->Slice(125, 50);
184+
ASSERT_EQ(slice->length(), 50);
185+
ASSERT_TRUE(slice->Equals(one_col_->Slice(125, 50)));
186+
187+
std::shared_ptr<Column> slice2 = one_col_->Slice(75)->Slice(25)->Slice(25, 50);
188+
ASSERT_EQ(slice2->length(), 50);
189+
ASSERT_TRUE(slice2->Equals(slice));
190+
}
191+
161192
TEST_F(TestColumn, Equals) {
162193
std::vector<bool> null_bitmap(100, true);
163194
std::vector<int32_t> data(100, 1);

0 commit comments

Comments
 (0)