Skip to content
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

Tp2000 1273 Draft - Do Not Merge - Upgrade Psycopg from v2 to v3 #1218

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

LaurenMullally
Copy link
Contributor

@LaurenMullally LaurenMullally commented Apr 23, 2024

TP2000-1273 Upgrade Psycopg - Draft PR DNM

Why

As part of the prep work for migrating from Govuk Paas to DBT Paas, we upgraded Postgres from v12 to v16 in Docker. It seemed fitting that we upgrade Psycopg as well seeing as they work together. We currently are on V2 known as Psycopg2, and want to upgrade to V3 known as just Psycopg. This ticket has been parked for the moment as upgrading has been tricker and more time consuming than we had hoped.

In the major upgrade, with little to no documentation, psycopg seems to move some modules around, and also remove the DateTimeRange class that we currently extend from for our TaricDateTimeRange. In efforts to sort of patch things back together, we're getting some strange behaviour where the end dates only of our ranges are having a day added on to them.

For example - If you go to the UI to make a quota, and give a validity date of 01/01/2024 to 01/01/2025, it will save in the DB as 2024-01-01 to 2025-01-02. This date range change shows in both the UI, shell plus, and in psql so is being saved to the DB incorrectly rather than a template mishap or something.

After doing some investigating, we've boiled it down to either an issue brought in by the range class I try to use to replace the deprecated DateTimeRange we use in our TaricDateTimeRange class.. or a more discreet issue that has appeared in the still supported DateRange class that's moved from the extras module to the types.ranges module (as they're the only things I change.. it's a bit baffling)

We parked this ticket as it's considered a 'nice to have' in comparison to the other tickets required for migrating onto the new DBT PaaS platform.. but when anyone picks this up, I hope this rundown helps!

Checklist

  • Requires migrations? No
  • Requires dependency updates? Yes

@PanosParalakis PanosParalakis added this to the DBT platform migration milestone Apr 23, 2024
@LaurenMullally LaurenMullally changed the title Tp2000 1273 upgrade psycopg Tp2000 1273 Draft - Do Not Merge - Upgrade Psycopg from v2 to v3 Apr 24, 2024
@LaurenMullally LaurenMullally added the do not merge PR is not ready to be merged label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge PR is not ready to be merged
Projects
None yet
2 participants