Skip to content

fix(cache): force keys to lowercase#272

Open
braddf wants to merge 3 commits intomainfrom
fix/cache-keys-lowercase
Open

fix(cache): force keys to lowercase#272
braddf wants to merge 3 commits intomainfrom
fix/cache-keys-lowercase

Conversation

@braddf
Copy link
Copy Markdown
Contributor

@braddf braddf commented Apr 1, 2026

Pull Request

Description

Forces all cache keys to lowercase by calling .lower() on the key_builder output, ensuring cache hits regardless of the case of query parameter values passed by the client.
Existing hardcoded warm keys are already lowercase so read/write consistency is maintained.
The @cache decorator uses key_builder for both lookup and store, so both paths are covered by this change.

Fixes #

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

  • Locally

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@braddf braddf requested a review from devsjc April 1, 2026 15:42
@peterdudfield
Copy link
Copy Markdown
Contributor

I wonder if the tests are failing becasue the timezon 'Z' got moved down to a z, this might have to be updated in the test

@braddf
Copy link
Copy Markdown
Contributor Author

braddf commented Apr 2, 2026

Yeah I think def something like that with the datetime strings – right now we're only aware of the boolean attributes that are allowed to be in whatever case, so have just made it more specific for now.

repr(sorted(permissions)),
],
)
).replace("False", "false").replace("True", "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.

couldnt you do lower?

And then I think in one of the tests you need to use t (not T) and z( not Z)?

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