-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: Unify SQLTable code for fallback and SQLAlchemy mode and move differences into database class #8562
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
Conversation
@artemyk Thanks for starting this! I don't have time at the moment, but will try to look at it later next week (in any case, this has to wait until 0.15 is released) |
@artemyk Coming back to this, sorry for the delay. I am looking at it, but to start, could you make a short schematic overview of what now belongs to which class (roughly the concepts)? That maybe eases the discussion. Furter, I think we should try to look at some of the usage cases mentioned in #7960, to see how they match with this PR. |
@jorisvandenbossche OK, going back to this and remind myself / reworking a bit more. The main motivation here is:
The constructor of the reworked Any instance of
The first 6 are pretty straightforward, while the last 4 are a bit novel. There's a lot of code changes here but functionally it actually ends up being not all that different from what was before. Maybe a bit cleaner? Not sure, what do you think? |
b37d7db
to
6b0516d
Compare
Comment fix Class hierarchy reorg Further refactoring Simplify SQLiteBackendTable Fixes Fixes
6b0516d
to
1893cce
Compare
status of this? |
@jreback Not sure, there does not seem to be much momentum behind these changes to unify the SQL API. #9960 is relevant too. |
It is mainly a time constraint I think. We need some more eyes to this, but haven't come around this. (but problem is the longer we wait, the more difficult it will become to change, as people start using the existing classes). |
@jorisvandenbossche One thing to think about is that this kind of design --- where logic and DB-specific things are separated as much as possible in different classes --- is that it may make it easier to extend pandas to allow for niche DB options / cases. One possibility I've been thinking about is the following: make a
DB-specific things could now be handled by extending/subclassing
More niche cases (which might not be merged into pandas) could subclass SQLConnection and pass that in. |
status on this? |
@jreback It doesn't seem like this PR is getting the code review / feedback needed. If you want to close it, that's fine w. me. |
@jorisvandenbossche is more of an expert on this |
@jorisvandenbossche status of this? |
1 similar comment
@jorisvandenbossche status of this? |
closing, pls reopen if you wish to update |
In discussion of the SQL API in #7960 , it has been suggested that it may be possible to factor out differences in SQLAlchemy and fallback backend . This is an initial attempt to do so. Now
SQLTable
is uncoupled from the backend.PandasSQL
is base class forSQLDatabase
(SQLAlchemy backend) andSQLiteDatabase
(fallback backend). This allows for the removal of some duplicate code.