Repository navigation
CLN: turn pandas.io.sql into a submodule - #71966
Open
fangchenli wants to merge 3 commits into
Open
fangchenli wants to merge 3 commits into
fangchenli wants to merge 3 commits into
Conversation
Split the 3,100-line pandas/io/sql.py into a package, one module per backend, as a pure move with no behavior change: - api.py: read_sql*, to_sql, has_table, get_schema, pandasSQL_builder - base.py: PandasSQL, SQLTable, result-wrapping and date-parsing helpers - sqla.py: SQLDatabase, BaseEngine, SQLAlchemyEngine, get_engine - adbc.py: ADBCDatabase - sqlite.py: SQLiteDatabase, SQLiteTable pandas/io/sql/__init__.py re-exports every public name the old module defined, plus DatabaseError, so `from pandas.io.sql import ...` keeps working. Helpers shared across modules lose their leading underscore (wrap_result, parse_date_columns, get_unicode_name) to satisfy the private-import-across-module check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reportGeneralTypeIssues exclude list still named the deleted pandas/io/sql.py. Exclude only the three new modules that inherit its pre-existing errors (base.py, sqla.py, sqlite.py); api.py, adbc.py and __init__.py are clean and stay checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Split
pandas/io/sql.py(~3,100 lines) into a submodule with one file per backend. This is a pure move with no behavior change, done as groundwork for follow-up work on the DBAPI2 fallback.api.py:read_sql*,to_sql,has_table,get_schema,pandasSQL_builderbase.py:PandasSQL,SQLTable, shared helperssqla.py,adbc.py,sqlite.py: one module per backendpandas.io.sqlre-exports every public name, so existing imports keep working. The three helpers shared across modules drop their leading underscore to satisfy the private-import check. Private names are no longer reachable aspandas.io.sql._X, and monkeypatching should now target the defining module (e.g.pandas.io.sql.api).closes #xxxx (Replace xxxx with the GitHub issue number)
Tests added and passed if fixing a bug or adding a new feature
All code checks passed.
Added type annotations to new arguments/methods/functions.
Added an entry in the latest
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.I have reviewed and followed all the contribution guidelines
Check exactly one of the following, per the automated contributions policy:
I did not use AI to develop this pull request.
I used AI to develop this pull request. I prompted it to follow
AGENTS.md, I have reviewed and understood every change, and I have described above how I used it and exactly which tool, model version, and effort setting — e.g.claude opus 4.8 (xhigh), not justclaude.🤖 Generated with Claude Code