Changeset: 4108c1b1624d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4108c1b1624d
Modified Files:
sql/backends/monet5/UDF/pyapi3/conversion3.c
sql/backends/monet5/UDF/pyapi3/pyapi3.c
Branch: default
Log Message:
layout
diffs (117 lines):
diff --git a/sql/backends/monet5/UDF/pyapi3/conversion3.c
b/sql/backends/monet5/UDF/pyapi3/conversion3.c
--- a/sql/backends/monet5/UDF/pyapi3/conversion3.c
+++ b/sql/backends/monet5/UDF/pyapi3/conversion3.c
@@ -355,14 +355,12 @@ PyArrayObject_FromBAT(PyInput *inp, size
}
{
- PyObject **data =
- ((PyObject
**)PyArray_DATA((PyArrayObject *)vararray));
+ PyObject **data = ((PyObject
**)PyArray_DATA((PyArrayObject *)vararray));
PyObject *obj;
j = 0;
if (unicode) {
if (GDK_ELIMDOUBLES(b->tvheap))
{
- PyObject **pyptrs =
-
GDKzalloc(b->tvheap->free * sizeof(PyObject *));
+ PyObject **pyptrs =
GDKzalloc(b->tvheap->free * sizeof(PyObject *));
if (!pyptrs) {
bat_iterator_end(&li);
msg =
createException(MAL, "pyapi3.eval",
@@ -379,13 +377,11 @@ PyArrayObject_FromBAT(PyInput *inp, size
// str_nil isn't a valid UTF-8 character
// (it's 0x80), so we can't decode it as
// UTF-8 (it will throw an error)
-
pyptrs[offset] =
-
PyUnicode_FromString("-");
+
pyptrs[offset] = PyUnicode_FromString("-");
} else {
// otherwise we can just decode the
// string as UTF-8
-
pyptrs[offset] =
-
PyUnicode_FromString(t);
+
pyptrs[offset] = PyUnicode_FromString(t);
}
if
(!pyptrs[offset]) {
bat_iterator_end(&li);
@@ -429,8 +425,7 @@ PyArrayObject_FromBAT(PyInput *inp, size
/* special case where we
exploit the
* duplicate-eliminated string
heap */
if (GDK_ELIMDOUBLES(b->tvheap))
{
- PyObject **pyptrs =
-
GDKzalloc(b->tvheap->free * sizeof(PyObject *));
+ PyObject **pyptrs =
GDKzalloc(b->tvheap->free * sizeof(PyObject *));
if (!pyptrs) {
bat_iterator_end(&li);
msg =
createException(MAL, "pyapi3.eval",
@@ -525,7 +520,8 @@ wrapup:
}
\
}
-PyObject *PyNullMask_FromBAT(BAT *b, size_t t_start, size_t t_end)
+PyObject *
+PyNullMask_FromBAT(BAT *b, size_t t_start, size_t t_end)
{
// We will now construct the Masked array, we start by setting
everything to
// False
@@ -886,6 +882,7 @@ PyObject_PreprocessObject(PyObject *pRes
// Now we have to do some preprocessing on the data
if (ret->multidimensional) {
+ assert(pColO==NULL);
// If it is a multidimensional Numpy array, we don't
need to do any
// conversion, we can just do some pointers
ret->count = PyArray_DIMS((PyArrayObject *)pResult)[1];
diff --git a/sql/backends/monet5/UDF/pyapi3/pyapi3.c
b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
--- a/sql/backends/monet5/UDF/pyapi3/pyapi3.c
+++ b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
@@ -236,8 +236,7 @@ static str PyAPIeval(Client cntxt, MalBl
if (getArgType(mb, pci, pci->retc) == TYPE_lng) {
has_card_arg=1;
card = (BUN) *getArgReference_lng(stk, pci, pci->retc);
- }
- else {
+ } else {
has_card_arg=0;
card = 1;
}
@@ -254,8 +253,7 @@ static str PyAPIeval(Client cntxt, MalBl
}
if ((pci->argc - (pci->retc + 2 + has_card_arg)) * sizeof(PyInput) > 0)
{
- pyinput_values =
- GDKzalloc((pci->argc - (pci->retc + 2 + has_card_arg))
* sizeof(PyInput));
+ pyinput_values = GDKzalloc((pci->argc - (pci->retc + 2 +
has_card_arg)) * sizeof(PyInput));
if (pyinput_values == NULL) {
GDKfree(args);
@@ -393,8 +391,7 @@ static str PyAPIeval(Client cntxt, MalBl
goto wrapup;
}
- memory_size =
- pci->retc * sizeof(ReturnBatDescr); // the memory size
for the
+ memory_size = pci->retc * sizeof(ReturnBatDescr); // the memory
size for the
// header files, each process
// has one per return value
@@ -1577,8 +1574,7 @@ static void ComputeParallelAggregation(A
gstate = Python_ObtainGIL();
for (group_it = p->group_start; group_it < p->group_end; group_it++) {
// we first have to construct new
- PyObject *pArgsPartial =
- PyTuple_New(p->named_columns + p->additional_columns);
+ PyObject *pArgsPartial = PyTuple_New(p->named_columns +
p->additional_columns);
PyObject *pColumnsPartial = PyDict_New();
PyObject *result;
size_t group_elements = (*p->group_counts)[group_it];
@@ -1679,8 +1675,7 @@ static void ComputeParallelAggregation(A
}
}
// fill in _columns array
- PyDict_SetItemString(pColumnsPartial,
(*p->args)[p->base + i],
- vararray);
+ PyDict_SetItemString(pColumnsPartial,
(*p->args)[p->base + i], vararray);
PyTuple_SetItem(pArgsPartial, ai++, vararray);
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]