Skip to content

refactor price api in prep for fastapi#11980

Merged
RayBB merged 1 commit intomasterfrom
fastapi-prep/refactor-price-api
Mar 3, 2026
Merged

refactor price api in prep for fastapi#11980
RayBB merged 1 commit intomasterfrom
fastapi-prep/refactor-price-api

Conversation

@RayBB
Copy link
Collaborator

@RayBB RayBB commented Mar 3, 2026

Closes #
Again, very simple refactor to make it easier to share code as we migrate to the fastapi version

Technical

Testing

Screenshot

Stakeholders

@RayBB
Copy link
Collaborator Author

RayBB commented Mar 3, 2026

AI review:

Review of PR #11980
What it does: Refactors the price API by extracting get_price_data() as a static method, returning the dict instead of JSON-encoding it in the method.
Risks:

  1. None - looks clean. The refactor simply:
    • Extracts logic into a reusable static method
    • Returns raw dict instead of json.dumps() in the extracted method
    • The GET() method still handles the JSON encoding
  2. Minor note: The original code used i.asin or normalize_isbn(i.isbn) but now uses asin or normalize_isbn(isbn) - this is a slightly cleaner pattern but functionally equivalent.
  3. No breaking changes - callers of GET() will see the same JSON output. Anyone calling get_price_data() directly (if it existed before) wouldn't have since it didn't exist.
    Verdict: Safe to merge. Standard refactor.

@RayBB RayBB merged commit 1a50f68 into master Mar 3, 2026
8 checks passed
@RayBB RayBB deleted the fastapi-prep/refactor-price-api branch March 3, 2026 00:28
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.

1 participant