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

Pass request by name into methods #44

Merged
merged 4 commits into from
Jun 20, 2023
Merged

Pass request by name into methods #44

merged 4 commits into from
Jun 20, 2023

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Jun 13, 2023

Related Issue(s):

Description:

Some downstreams, e.g. the Planetary Computer, use the request as a part of their caching mechanism. #22 has some internal calls to functions where request is passed as a positional parameter, which breaks generic caching mechanism, which fetch request from kwargs. This PR changes to make sure those internal calls pass request by name.

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

@gadomski gadomski requested a review from mmcfarland June 13, 2023 18:50
@gadomski gadomski self-assigned this Jun 13, 2023
@gadomski gadomski added this to the 2.4.9 milestone Jun 13, 2023
@gadomski gadomski requested a review from pjhartzell June 13, 2023 19:39
@gadomski gadomski enabled auto-merge (squash) June 13, 2023 19:39
Copy link
Contributor

@pjhartzell pjhartzell left a comment

Choose a reason for hiding this comment

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

Are we concerned about regression? Or do we trust future devs to inspect the history and understand that there is a reason (untested) for these positional args to be passed as keyword args?

@gadomski
Copy link
Member Author

Are we concerned about regression? Or do we trust future devs to inspect the history and understand that there is a reason (untested) for these positional args to be passed as keyword args?

It's a good point. We could sprinkle comments around explaining what's going on, but that feels like a bit of a rabbit hole. I think it's ok to just have the explanation in the git/github history.

@pjhartzell
Copy link
Contributor

Would a test be overkill? A regression would fail the test, which would make clear that those args are keyword-ed for a reason.

@gadomski
Copy link
Member Author

No a test makes sense, I'll add something that mimics what the PC is doing.

@gadomski
Copy link
Member Author

Whelp, that test ended up being more involved than expected, but got it.

@gadomski gadomski requested a review from pjhartzell June 16, 2023 17:49
@gadomski gadomski merged commit 659e46f into main Jun 20, 2023
6 checks passed
@gadomski gadomski deleted the pass-request-by-name branch June 20, 2023 18:09
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