Skip to content

Commit 7c1dde0

Browse files
devin-petersohnsfc-gh-dpetersohnsfc-gh-mvashishtha
authored
FEAT-modin-project#7331: Initial Polars API (modin-project#7332)
* FEAT-modin-project#7331: Initial Polars API This commit adds a polars namespace to Modin, and the DataFrame and Series objects and their respective APIs. This doesn't include error handling and is still missing several polars features: * LazyFrame * Expressions * String, Temporal, Struct, and other Series accessors * Several parameters * Operators that we don't have query compiler methods for * e.g. sin, cos, tan, etc. Those will be handled in a future PR. Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Lint Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * flake8 Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * isort Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * headers Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * forgot one Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Add test Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * header Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * isort Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Add to CI Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * fix name Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Update modin/polars/base.py Co-authored-by: Mahesh Vashishtha <mahesh.vashishtha@snowflake.com> * address comments Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * polars 1 Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Update for polars 1.x and fix some hacks Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Remove hax Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Black Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Address comments Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Lint Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> * Address comment Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> --------- Signed-off-by: Devin Petersohn <devin.petersohn@snowflake.com> Co-authored-by: Devin Petersohn <devin.petersohn@snowflake.com> Co-authored-by: Mahesh Vashishtha <mahesh.vashishtha@snowflake.com>
1 parent f5f9ae9 commit 7c1dde0

File tree

9 files changed

+4579
-0
lines changed

9 files changed

+4579
-0
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ jobs:
462462
if: matrix.engine == 'python' || matrix.test_task == 'group_4'
463463
- run: python -m pytest modin/tests/interchange/dataframe_protocol/pandas/test_protocol.py
464464
if: matrix.engine == 'python' || matrix.test_task == 'group_4'
465+
- run: python -m pytest modin/tests/polars/test_dataframe.py
465466
- run: |
466467
python -m pip install lazy_import
467468
python -m pytest modin/tests/pandas/integrations/

environment-dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ dependencies:
7070
- git+https://github.com/modin-project/modin-spreadsheet.git@49ffd89f683f54c311867d602c55443fb11bf2a5
7171
# The `numpydoc` version should match the version installed in the `lint-pydocstyle` job of the CI.
7272
- numpydoc==1.6.0
73+
- polars

modin/polars/__init__.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Licensed to Modin Development Team under one or more contributor license agreements.
2+
# See the NOTICE file distributed with this work for additional information regarding
3+
# copyright ownership. The Modin Development Team licenses this file to you under the
4+
# Apache License, Version 2.0 (the "License"); you may not use this file except in
5+
# compliance with the License. You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under
10+
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific language
12+
# governing permissions and limitations under the License.
13+
14+
from modin.polars.dataframe import DataFrame
15+
from modin.polars.series import Series
16+
17+
__all__ = ["DataFrame", "Series"]

0 commit comments

Comments
 (0)