Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feature/app-159-family-page-errors-in-the-admin-when-trying-to-update #281

Conversation

odrakes-cpr
Copy link
Contributor

Description

Fix - family updates error when trying to update documents and events in the admin service

error due to multiple rows found when running update_intention for a single geo id - which fails on families with multiple geographies.

Please include:

  • a summary of the changes
  • links to any related issue/ticket
  • any additional relevant motivation and context
  • details of any dependency updates that are required for this change

Proposed version

Please select the option below that is most relevant from the list below. This
will be used to generate the next tag version name during auto-tagging.

  • Skip auto-tagging
  • Patch
  • Minor version
  • Major version

Visit the Semver website to understand the
difference between MAJOR, MINOR, and PATCH versions.

Notes:

  • If none of these options are selected, auto-tagging will fail
  • Where multiple options are selected, the most senior option ticked will be
    used -- e.g. Major > Minor > Patch
  • If you are selecting the version in the list above using the textbox, make
    sure your selected option is marked [x] with no spaces in between the
    brackets and the x

Type of change

Please select the option(s) below that are most relevant:

  • Bug fix
  • New feature
  • Breaking change
  • GitHub workflow update
  • Documentation update
  • Remove legacy code
  • Dependency update

How Has This Been Tested?

Please describe the tests that you added to verify your changes.

Reviewer Checklist

  • DB_CLIENT DEPENDENCY IS ON THE LATEST VERSION
  • The PR represents a single feature (small drive-by fixes are also ok)
  • The PR includes tests that are sufficient for the level of risk
  • The code is sufficiently commented, particularly in hard-to-understand areas
  • Any required documentation updates have been made
  • Any TODOs added are captured in future tickets
  • No FIXMEs remain

Osneil Drakes and others added 10 commits January 13, 2025 17:10
…ys in the payload, so an error will raise if its not included
I had originally left this in because I wanted to do the tidy up of the
geographies parameter separately, it seems that it causes an
intermittent bug that only gets triggered when you try and update one of
the basic properties. It is expecting the query to return one geo id but
it does not when we have families with multiple geos per the title so it
fails with :

Raises sqlalchemy.orm.exc.NoResultFound if the query selects no rows. Raises sqlalchemy.orm.exc.MultipleResultsFound if multiple object identities are returned, or if multiple rows are returned for a query that returns only scalar values as opposed to full identity-mapped entities.
we are removing its use in the repository update function
cleanup will be handled in a separate ticket
allows users to access postico and other agents of the db in the dev container
@odrakes-cpr odrakes-cpr requested a review from a team as a code owner January 16, 2025 08:46
Copy link

linear bot commented Jan 16, 2025

Copy link
Contributor

@annaCPR annaCPR left a comment

Choose a reason for hiding this comment

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

All good but I would like more tests please :)

tests/integration_tests/family/test_update.py Show resolved Hide resolved
@odrakes-cpr odrakes-cpr merged commit 05108fa into main Jan 16, 2025
10 checks passed
@odrakes-cpr odrakes-cpr deleted the fix-multiple-rows-found-when-running-update-with-multiple-geographies branch January 16, 2025 11:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants