Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdc/hiframes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from numba.core.typing import signature
from numba.core.typing.templates import infer_global, AbstractTemplate, CallableTemplate
from numba.extending import overload, intrinsic
from numba.core.imputils import (lower_builtin, impl_ret_borrowed)
from numba.core.imputils import (lower_builtin, impl_ret_borrowed, impl_ret_new_ref)

import sdc
from sdc.str_ext import string_type, list_string_array_type
Expand Down Expand Up @@ -168,7 +168,7 @@ def generic(self, args, kws):
def lower_fix_df_array(context, builder, sig, args):
func = fix_df_array_overload(sig.args[0])
res = context.compile_internal(builder, func, sig, args)
return impl_ret_borrowed(context, builder, sig.return_type, res)
return impl_ret_new_ref(context, builder, sig.return_type, res)


def fix_df_array_overload(column):
Expand Down
5 changes: 5 additions & 0 deletions sdc/hiframes/boxing.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,21 @@ def unbox_series(typ, val, c):
if typ.index == string_array_type:
index_obj = c.pyapi.object_getattr_string(val, "index")
series.index = unbox_str_series(string_array_type, index_obj, c).value
c.pyapi.decref(index_obj)

if isinstance(typ.index, types.Array):
index_obj = c.pyapi.object_getattr_string(val, "index")
index_data = c.pyapi.object_getattr_string(index_obj, "_data")
series.index = unbox_array(typ.index, index_data, c).value
c.pyapi.decref(index_obj)
c.pyapi.decref(index_data)

if typ.is_named:
name_obj = c.pyapi.object_getattr_string(val, "name")
series.name = numba.cpython.unicode.unbox_unicode_str(
string_type, name_obj, c).value
c.pyapi.decref(name_obj)

# TODO: handle index and name
c.pyapi.decref(arr_obj)
return NativeValue(series._getvalue())
Expand Down
2 changes: 1 addition & 1 deletion sdc/str_arr_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def box_str_arr(typ, val, c):
string_array.data, string_array.null_bitmap])

# TODO: double check refcounting here
# c.context.nrt.decref(c.builder, typ, val)
c.context.nrt.decref(c.builder, typ, val)
return arr # c.builder.load(arr)


Expand Down