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

Clean up some deprecation warnings #12469

Merged

Conversation

rtibbles
Copy link
Member

Summary

The migration to Django 3.2 left some deprecation warnings, this cleans up the following:

  • We no longer need to define the default app config in the app's init.py, Django automagically discovers it in the apps.py
  • The DRF filter_fields has been deprecated in favour of filterset_fields
  • Django will soon disallow objects that are not compatible with copy.deepcopy() from being set on the class object during setUpTestData - the workaround for this is to do it in setUpClass. If needed in setUpTestData as it is here, this is done prior to the super call (during which setUpTestData is called).
  • DRF has deprecated the get_filter_class method in favour of get_filterset_class method
  • SQLAlchemy has deprecated a large range of its API, especially around its ORM, so I have made numerous updates to our use of SQLAlchemy here, in line with https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-to-2-0-step-two-turn-on-removedin20warnings
  • Removed our usage of most bare assert statements outside of tests, except where it was very clearly intended to be a developer only warning

References

There is no open issue for this, I just got sick of seeing these warnings when running tests locally.

Reviewer guidance

If tests all pass, this should give some decent confidence - but I am targeting this to a patch release to defer the risk slightly.


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added the TODO: needs review Waiting for review label Jul 18, 2024
@github-actions github-actions bot added the DEV: backend Python, databases, networking, filesystem... label Jul 18, 2024
Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense and look good to me

@bjester bjester merged commit 81893fd into learningequality:release-v0.17.x Aug 8, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend Python, databases, networking, filesystem... TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants