Skip to content

Commit

Permalink
FEAT-#7070: Add modin.pandas.arrays module (#7071)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev authored Mar 13, 2024
1 parent 909afdd commit ac4bb25
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modin/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _update_engine(publisher: Parameter):
_is_first_update[publisher.get()] = False


from modin.pandas import errors
from modin.pandas import arrays, errors
from modin.utils import show_versions

from .. import __version__
Expand Down
18 changes: 18 additions & 0 deletions modin/pandas/arrays/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.


"""The module is needed to allow the following import `import modin.pandas.arrays`."""

from pandas.arrays import * # noqa: F403, F401
from pandas.arrays import __all__ # noqa: F401
1 change: 0 additions & 1 deletion modin/pandas/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def test_top_level_api_equality():
"util",
"offsets",
"datetime",
"arrays",
"api",
"tseries",
"to_msgpack", # This one is experimental, and doesn't look finished
Expand Down
14 changes: 14 additions & 0 deletions modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,20 @@ def test_constructor_columns_and_index():
pd.Series(modin_series, index=[1, 2, 99999])


def test_constructor_arrow_extension_array():
# example from pandas docs
pa = pytest.importorskip("pyarrow")
array = pd.arrays.ArrowExtensionArray(
pa.array(
[{"1": "2"}, {"10": "20"}, None],
type=pa.map_(pa.string(), pa.string()),
)
)
md_ser, pd_ser = create_test_series(array)
df_equals(md_ser, pd_ser)
df_equals(md_ser.dtypes, pd_ser.dtypes)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
def test_copy(data):
modin_series, pandas_series = create_test_series(data)
Expand Down

0 comments on commit ac4bb25

Please sign in to comment.