Skip to content

POC of PDEP-9 (I/O plugins) #53005

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

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
raising if to_ method exists
  • Loading branch information
datapythonista committed May 22, 2023
commit 000ea21adfba4f5c7a91260a1c16bb1f8da9b048
8 changes: 7 additions & 1 deletion pandas/io/_plugin_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def load_io_plugins():
raise RuntimeError(
"More than one installed library provides the "
"`read_{format_name}` reader. Please uninstall one of "
"the I/O plugins to be able to load the pandas I/O plugins."
"the I/O plugins providing connectors for this format."
)
setattr(
pd,
Expand All @@ -136,6 +136,12 @@ def load_io_plugins():
)

if hasattr(io_plugin, f"{exchange_format}_writer"):
if hasattr(pd.DataFrame, f"to_{format_name}"):
raise RuntimeError(
"More than one installed library provides the "
"`to_{format_name}` reader. Please uninstall one of "
"the I/O plugins providing connectors for this format."
)
setattr(
pd.DataFrame,
f"to_{format_name}",
Expand Down