Skip to content

Additional get params #108

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

Merged
merged 8 commits into from
May 13, 2025

Conversation

chinacat567
Copy link
Contributor

@chinacat567 chinacat567 commented Apr 30, 2025

Context

Change

Passing additional GET params as a query string to the following methods

GET Methods
Retrieve functions
Data
  • retrieve_study
  • retrieve_instance
  • retrieve_series
  • retrieve_instance_frames
  • retrieve_bulkdata

NOTE : retrieve_instance_rendered and retrieve_instance_frames_rendered contain a preexisitng arugment 'params', hence no modifications were made to these

Metadata
  • retrieve_study_metadata
  • retrieve_series_metadata
  • retrieve_instance_metadata
Iter functions
  • iter_study
  • iter_series
  • iter_bulkdata
Search functions
  • search_for_instances
  • search_for_studies
  • search_for_series
POST Methods
  • store_instances
DELETE Methods
  • delete_study
  • delete_instances
  • delete_series

Testing

  • Added tests to check that that the additional params are being passed as a query string to the request for each method
  • pytest tests/test_web.py
  • pytest --flake8

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@chinacat567 chinacat567 reopened this Apr 30, 2025
@CPBridge CPBridge self-requested a review May 5, 2025 14:58
@CPBridge CPBridge self-assigned this May 5, 2025
@CPBridge CPBridge added the enhancement New feature or request label May 5, 2025
@CPBridge
Copy link
Collaborator

CPBridge commented May 5, 2025

Hi @chinacat567

Thanks for this pull request, but there appear to be many changes unrelated to the purpose of the PR. For example pyproject.toml and setup.py have changed for no apparent reason, and many files have been renamed. Could you please undo those changes so that the PR is limited just to the addition of additional http parameters?

Copy link
Collaborator

@CPBridge CPBridge left a comment

Choose a reason for hiding this comment

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

Please remove unnecessary changes

@chinacat567
Copy link
Contributor Author

Hi @chinacat567

Thanks for this pull request, but there appear to be many changes unrelated to the purpose of the PR. For example pyproject.toml and setup.py have changed for no apparent reason, and many files have been renamed. Could you please undo those changes so that the PR is limited just to the addition of additional http parameters?

Sorry about that! Those commits were accidental — I’ll undo them soon.

@chinacat567 chinacat567 force-pushed the additional_get_params branch from ffbf99e to 315ff41 Compare May 6, 2025 14:41
@chinacat567 chinacat567 requested a review from CPBridge May 6, 2025 14:42
Copy link
Collaborator

@CPBridge CPBridge left a comment

Choose a reason for hiding this comment

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

One very minor change. Otherwise I think this looks good to me, thank you @chinacat567 .

@pieper any other thoughts?

@medihack
Copy link
Contributor

medihack commented May 8, 2025

It makes sense to add that additional_params parameter to the store functions. We don't have a direct use for it, but for consistency.

@CPBridge By the way, in our fork we switched over to using uv with an automatic publish workflow and dynamic versioning. So if you are interested, we can contribute it back to this repo. I wasn't sure how well dicomweb-client is currently maintained, and I have no problem with deleting our fork again.

@chinacat567 chinacat567 marked this pull request as draft May 8, 2025 07:32
@chinacat567 chinacat567 marked this pull request as ready for review May 8, 2025 12:47
@chinacat567 chinacat567 requested a review from CPBridge May 8, 2025 12:48
@chinacat567 chinacat567 marked this pull request as draft May 8, 2025 16:27
@CPBridge
Copy link
Collaborator

CPBridge commented May 8, 2025

I have approved. We'll give a few days to see if @pieper has a different opinion, and then we can merge and I'll push out a 0.60.0 release.

@CPBridge By the way, in our fork we switched over to using uv with an automatic publish workflow and dynamic versioning. So if you are interested, we can contribute it back to this repo.

@medihack I think switching to improved tooling would be a good thing if you are happy to contribute!

I wasn't sure how well dicomweb-client is currently maintained, and I have no problem with deleting our fork again.

I am committed to maintaining this repo going forward following @hackermd stepping back (though there was a bit of a dead period during the transition), but it isn't my highest priority and I don't plan to add any major new features myself, though I'm happy to consider PRs. Do you have any particular changes you might be looking to make in the future?

@chinacat567 chinacat567 force-pushed the additional_get_params branch from 0d427a9 to 40ffe7f Compare May 9, 2025 07:57
@medihack
Copy link
Contributor

medihack commented May 9, 2025

I am committed to maintaining this repo going forward following @hackermd stepping back (though there was a bit of a dead period during the transition), but it isn't my highest priority and I don't plan to add any major new features myself, though I'm happy to consider PRs. Do you have any particular changes you might be looking to make in the future?

@CPBridge Fair enough, but I also can't think of any major new features (maybe additional async support by using httpx, but we currently don't need that with ADIT, in which we use this library).

How do you currently release new versions to PyPI? The nice thing about the GitHub Action publish workflow we added to our fork is that it will automatically get published to PyPI with the same version when you make a GitHub release. But not sure if you want something like that.

@chinacat567 chinacat567 marked this pull request as ready for review May 9, 2025 11:52
@pieper
Copy link
Member

pieper commented May 9, 2025

Thanks for the contribution 👍 Like @CPBridge I want to see this project continue but it's not a high priority. I also would like to see async support since it's important for interactive use, but it's also not high on my priority list.

Regarding this PR, should the opional headers be Dict[str, str] and not Dict[str, Any]?

@chinacat567
Copy link
Contributor Author

chinacat567 commented May 9, 2025

Regarding this PR, should the opional headers be Dict[str, str] and not Dict[str, Any]?

Using Dict[str, Any] to pass parameters is a consistent pattern already established in retrieve_series_rendered and retrieve_instance_rendered. A sample test case for this involves nested query parameters represented as key-value mappings. If a key needs to appear multiple times with different values, the values should be provided as an iterable—for example, {"key": ["value1", "value2"]}

@pieper
Copy link
Member

pieper commented May 9, 2025

If a key needs to appear multiple times with different values, the values should be provided as an iterable—for example, {"key": ["value1", "value2"]}

Oh, interesting, I didn't realize that was an option! I guess that's the point of the typing annotations so these things can be made more clear. It doesn't need to be part of this PR, but perhaps we should refine these typings to be more specific that the values can be strings or lists of strings (anything else?) rather than just Any.

@chinacat567 chinacat567 reopened this May 11, 2025
Copy link

@chinacat567
Copy link
Contributor Author

chinacat567 commented May 12, 2025

@CPBridge By the way, in our fork we switched over to using uv with an automatic publish workflow and dynamic versioning. So if you are interested, we can contribute it back to this repo.

@medihack I think switching to improved tooling would be a good thing if you are happy to contribute!

@CPBridge I have created a PR for this here

@CPBridge CPBridge merged commit 874222d into ImagingDataCommons:master May 13, 2025
7 checks passed
@CPBridge
Copy link
Collaborator

Thanks @chinacat567 !

@CPBridge
Copy link
Collaborator

P.s. I'll maybe wait for #114 before making a new release. Unless you think that doesn't make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants