Skip to content

[NO TICKET]: Decrease load time for geospatil API #276

Closed
jirhiker wants to merge 1 commit into
stagingfrom
jir-geospatial-speed-up
Closed

[NO TICKET]: Decrease load time for geospatil API #276
jirhiker wants to merge 1 commit into
stagingfrom
jir-geospatial-speed-up

Conversation

@jirhiker

@jirhiker jirhiker commented Dec 7, 2025

Copy link
Copy Markdown
Member

Why

This PR addresses the following problem / context:

  • Eager loading all Thing associations made the API too slow and non operational.

How

Implementation summary - the following was changed / added / removed:

  • Comment out all use of eager loading for Thing associations. e.g. location_associations

Notes

Any special considerations, workarounds, or follow-up work to note?

  • with this simple fix performance increase 10X

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread db/thing.py
Comment on lines 351 to +352
# for temporary backwards compatibility
well_construction_notes = mapped_column(String(1000), nullable=True)
# well_construction_notes = mapped_column(String(1000), nullable=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore mapping for well_construction_notes

Commenting out well_construction_notes removes the ORM attribute from Thing, so any code that tries to read or serialize this field now fails. Thing responses still include the field (e.g., schemas/thing.py:409) and tests assert it is present (e.g., tests/test_thing.py:454-456), so hitting water-well endpoints will raise an AttributeError or drop the column from API output. This regression affects every request that fetches or updates wells with construction notes.

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Dec 7, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
api/geospatial.py 97.61% <100.00%> (ø)
db/thing.py 97.95% <ø> (-2.05%) ⬇️
services/query_helper.py 36.08% <ø> (+2.42%) ⬆️

... and 24 files with indirect coverage changes

@jirhiker jirhiker changed the title feat: update type hints for clarity and comment out lazy loading in relationships for performance testing [NO TICKET]: Decrease load time for geospatil API Dec 7, 2025
Comment thread db/thing.py

# for temporary backwards compatibility
well_construction_notes = mapped_column(String(1000), nullable=True)
# well_construction_notes = mapped_column(String(1000), nullable=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well_construction_notes was removed from the thing model during the implementation of well-notes.feature. Rather than comment it out I think that it can be removed altogether.

@jirhiker

jirhiker commented Dec 8, 2025

Copy link
Copy Markdown
Member Author

eager loading addressed by PR #277

@jirhiker jirhiker closed this Dec 8, 2025
@jirhiker jirhiker deleted the jir-geospatial-speed-up branch March 12, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants