-
Notifications
You must be signed in to change notification settings - Fork 15
[BSE-4737] Implement interface for using bodo as engine in Pandas UDFs. #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2662e72
add BodoExecutionEngine class and implement basic apply method
scott-routledge2 cafbc21
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] bda9f6b
add more tests
scott-routledge2 4391e8c
get some tests to pass
scott-routledge2 bc916d7
Merge branch 'scott/pandas_bodo_executor' of https://github.com/bodo-…
scott-routledge2 9407fe9
tests passing
scott-routledge2 3da1514
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e01bda1
restore env
scott-routledge2 48d1694
[run ci]
scott-routledge2 e13ff24
Merge branch 'scott/pandas_bodo_executor' of https://github.com/bodo-…
scott-routledge2 a6cf81e
[run ci]
scott-routledge2 d76983b
support kwargs
scott-routledge2 a177ea6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2325d0a
simplify func_text
scott-routledge2 e6d3bf7
Merge branch 'scott/pandas_bodo_executor' of https://github.com/bodo-…
scott-routledge2 b6eed0c
docstring
scott-routledge2 fea5452
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e9cc70d
restore pixi files [run ci]
scott-routledge2 ef33644
pr comments
scott-routledge2 e97d895
typo
scott-routledge2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| """ | ||
| This file tests the Bodo implementation of the Pandas UDF interface. | ||
| See https://github.com/pandas-dev/pandas/pull/61032 for more details. | ||
|
|
||
| This feature is only availible on newer versions of Pandas (>=3.0) | ||
| """ | ||
|
|
||
| import numpy as np | ||
| import pandas as pd | ||
| import pytest | ||
|
|
||
| import bodo | ||
| from bodo.pandas_compat import pandas_version | ||
| from bodo.tests.utils import _test_equal, pytest_spawn_mode | ||
|
|
||
| pytestmark = [ | ||
| pytest.mark.skipif( | ||
| pandas_version < (3, 0), reason="Third-party UDF engines requires Pandas >= 3.0" | ||
| ) | ||
| ] + pytest_spawn_mode | ||
|
|
||
|
|
||
| def test_basic_apply_example(): | ||
| """Simplest test to check Pandas UDF apply hook is set up properly""" | ||
|
|
||
| df = pd.DataFrame({"A": np.arange(30)}) | ||
|
|
||
| bodo_result = df.apply(lambda x: x.A, axis=1, engine=bodo.jit) | ||
|
|
||
| pandas_result = df.apply(lambda x: x.A, axis=1) | ||
|
|
||
| _test_equal(bodo_result, pandas_result, check_pandas_types=False) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,6 @@ pip = "*" | |
| # Core Python Deps | ||
| numba = "==0.61.0" | ||
| numpy = ">=1.24,<2.2" | ||
| pandas = ">=2.2,<2.3" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For testing locally, will restore before merging. |
||
| pyarrow = { version = "==19.0.0", channel = "conda-forge" } | ||
| fsspec = ">=2021.09" | ||
| requests = "*" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not implemented yet in Pandas so there is no way to test. Leaving as a followup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a PR adding
enginetoSeries.mapshortly. I have the implementation already, but map and apply tests are structured very differently, and I need to see how to implement the common fixtures without making the mess bigger or refactoring all the tests.