palewire / django-postgres-copy

Quickly import and export delimited data with Django support for PostgreSQL's COPY command
https://palewi.re/docs/django-postgres-copy/
MIT License
180 stars 48 forks source link

Django 4.2+ compatible setup_query #167

Closed bbajuzik closed 1 year ago

bbajuzik commented 1 year ago

This PR should fix the incompatibility described in the issue https://github.com/palewire/django-postgres-copy/issues/160

bbajuzik commented 1 year ago

I apologize for starting a new PR. I did notice the https://github.com/palewire/django-postgres-copy/pull/166 right after I submitted this one (as usual :sweat_smile: ).

I do however believe that this PR's solution is faster, simpler, less error-prone, and more future-proof than inspecting super().setup_query and deciding which kwargs to use. And since this is an inherited method, we do not need to re-declare the defaults, we can just pass whatever the callee passed in and let the parent's implementation handle it.

jykae commented 1 year ago

@bbajuzik would be cool if fix is this simple, probably less error prone than PR mentioned. Anyway happy if this incompatibility would get solved for this great tool.

palewire commented 1 year ago

I'm happy to merge one of these patches but we need to get some testing in for 4.2 and this feature, it seems.

palewire commented 1 year ago

The fix has been released as a new version. Give it a shot and let me know if there are still any problems.