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

[COST-2231] Upgrade to Django 4 #4844

Merged
merged 11 commits into from
Feb 19, 2024
Merged

[COST-2231] Upgrade to Django 4 #4844

merged 11 commits into from
Feb 19, 2024

Commits on Feb 16, 2024

  1. [COST-4514] Upgrade to django 4.0 (#4839)

    * Remove gettext alias
    * Mocks for get_response required by middlewaremixin
    * Use method_decorator to apply neevr_cache on class method
    * Method set_context deprecated in DRF 3.12 in favor of requires_context
    * User Django RedisCache and remove django_redis library
    samdoran committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    b05c25c View commit details
    Browse the repository at this point in the history
  2. [COST-4515] Upgrade to Django 4.1 (#4853)

    * Update deprecated ‘warn’ method
    * Remove deprecated test case method
    * Remove deprecated Series.bool method
    * Correct docstring and class attribute name
    * Cleanup file handle
    * Fix flaky test
    
      This assert statement will always fail since the template schema does not yet
      exists. This test will only pass if another test runs before this test creates
      the template schema.
    
    * Update clone_schema.sql
    
      Do not define a custom sequence object since that is no longer required with the
      move to identity columns.
    
      Do not define a custom sequence object since that is no longer required with the
      move to identity columns.
    
    * Avoid unnecessary globals
    * Add management command to migrate serial ID columns to identity
    
    * Update license information
    
      Add correct copyright and license information to management command.
    
      Create project level licenses to reflect the use of multiple licenses within
      the project.
    
    * Improvements to serial to identity management command
    
      Use SQL composition rather than format strings to protect against SQL injection
      attacks. The risk is quite low, but it’s best to just do the right thing.
      Reorganize the code to avoid a nested function definiton and an unnecessary
      global variable that only needed to be local.
    
    * Add migration to update clone_schema function
    
    ---------
    
    Co-authored-by: Sam Doran <[email protected]>
    Co-authored-by: Michael Skarbek <[email protected]>
    Co-authored-by: David Nakabaale <[email protected]>
    3 people committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    b155088 View commit details
    Browse the repository at this point in the history
  3. [COST-4516] Upgrade to Django 4.2 (#4893)

    * Clean up unittest  test_execute_query_with_group_by_tag_and_limit
    * Move Window after aggregation in group_by annotation
    
      Since the Window is used only to provide row numbers and there is no additional
      filtering done on the data in the Window, moving it after the ArrayAgg fixes the
      error encountered in Django 4.2 and returns the same data in the same order.
    
    * Check correct log level in test
      This works in Python 3.9 due to a bug in unittest.
    
    * Use test database name from settings instead of hard coding it
    * Use consistent name for test database
    * Correct patching in test
    djnakabaale authored and samdoran committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    fc1bd22 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8c513f6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c7da479 View commit details
    Browse the repository at this point in the history
  6. Explicitly set the test database name

    Currently we are relying on Django’s internal test setup to add a `test_` prefix
    to the default database name. This works fine most of the time but it’s better
    to be explicit.
    samdoran committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    c1e25b8 View commit details
    Browse the repository at this point in the history
  7. Use method call instead of operator

    This prevents tripping up flake8 and the need for an ignore or parenthesis
    samdoran committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    81d456a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a760f98 View commit details
    Browse the repository at this point in the history
  9. Remove migration that updates clone_schema SQL function

    Handling this exclusively with the migrate_serial_to_identity_columns
    management command
    samdoran committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    eabc396 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1c00ee6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7060573 View commit details
    Browse the repository at this point in the history