|
39 | 39 |
|
40 | 40 | from sdc.datatypes.range_index_type import RangeIndexType |
41 | 41 | from sdc.datatypes.int64_index_type import Int64IndexType |
42 | | -from sdc.datatypes.common_functions import SDCLimitation, _sdc_take |
43 | 42 | from sdc.utilities.utils import sdc_overload, sdc_overload_attribute, sdc_overload_method |
44 | 43 | from sdc.utilities.sdc_typing_utils import TypeChecker, check_is_numeric_array, check_signed_integer |
45 | | -from sdc.functions.numpy_like import getitem_by_mask |
46 | | -from sdc.functions.numpy_like import astype as nplike_astype |
| 44 | +from sdc.functions import numpy_like |
47 | 45 | from numba.core.boxing import box_array, unbox_array |
48 | 46 | from sdc.hiframes.api import fix_df_index |
49 | 47 | from sdc.extensions.indexes.indexes_generic import _check_dtype_param_type |
@@ -128,7 +126,7 @@ def pd_int64_index_ctor_impl(data, dtype=None, copy=False, name=None): |
128 | 126 | _data = fix_df_index(data)._data |
129 | 127 |
|
130 | 128 | if data_dtype_is_int64 == False: # noqa |
131 | | - _data = nplike_astype(_data, dtype=types.int64) |
| 129 | + _data = numpy_like.astype(_data, dtype=types.int64) |
132 | 130 | else: |
133 | 131 | if copy: |
134 | 132 | _data = np.copy(_data) |
@@ -291,7 +289,8 @@ def pd_int64_index_copy_overload(self, name=None, deep=False, dtype=None): |
291 | 289 | def pd_int64_index_copy_impl(self, name=None, deep=False, dtype=None): |
292 | 290 |
|
293 | 291 | _name = self._name if keep_name == True else name # noqa |
294 | | - return init_int64_index(self._data, _name) |
| 292 | + new_index_data = self._data if not deep else numpy_like.copy(self._data) |
| 293 | + return init_int64_index(new_index_data, _name) |
295 | 294 |
|
296 | 295 | return pd_int64_index_copy_impl |
297 | 296 |
|
@@ -408,6 +407,10 @@ def pd_int64_index_ravel_overload(self, order='C'): |
408 | 407 | raise TypingError('{} Unsupported parameters. Given order: {}'.format(_func_name, order)) |
409 | 408 |
|
410 | 409 | def pd_int64_index_ravel_impl(self, order='C'): |
| 410 | + # np.ravel argument order is not supported in Numba |
| 411 | + if order != 'C': |
| 412 | + raise ValueError(f"Unsupported value for argument 'order' (only default 'C' is supported)") |
| 413 | + |
411 | 414 | return self.values |
412 | 415 |
|
413 | 416 | return pd_int64_index_ravel_impl |
0 commit comments