Skip to content

ENH: set __module__ on merge functions in merge.py #60266

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
Show file tree
Hide file tree
Changes from 2 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
8 changes: 7 additions & 1 deletion pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
npt,
)
from pandas.errors import MergeError
from pandas.util._decorators import cache_readonly
from pandas.util._decorators import (
cache_readonly,
set_module,
)
from pandas.util._exceptions import find_stack_level

from pandas.core.dtypes.base import ExtensionDtype
Expand Down Expand Up @@ -138,6 +141,7 @@
_known = (np.ndarray, ExtensionArray, Index, ABCSeries)


@set_module("pandas")
def merge(
left: DataFrame | Series,
right: DataFrame | Series,
Expand Down Expand Up @@ -502,6 +506,7 @@ def _groupby_and_merge(
return result, lby


@set_module("pandas")
def merge_ordered(
left: DataFrame | Series,
right: DataFrame | Series,
Expand Down Expand Up @@ -645,6 +650,7 @@ def _merger(x, y) -> DataFrame:
return result


@set_module("pandas")
def merge_asof(
left: DataFrame | Series,
right: DataFrame | Series,
Expand Down
3 changes: 3 additions & 0 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,6 @@ def test_set_module():
assert pd.Period.__module__ == "pandas"
assert pd.Timestamp.__module__ == "pandas"
assert pd.Timedelta.__module__ == "pandas"
assert pd.merge.__module__ == "pandas"
assert pd.merge_ordered.__module__ == "pandas"
assert pd.merge_asof.__module__ == "pandas"