Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Cd 646 change show term count for unique terms to show counts#223

Open
dionboles-asym wants to merge 14 commits into
developfrom
CD-646-change-show_term_count-for-unique_terms-to-show_counts
Open

Cd 646 change show term count for unique terms to show counts#223
dionboles-asym wants to merge 14 commits into
developfrom
CD-646-change-show_term_count-for-unique_terms-to-show_counts

Conversation

@dionboles-asym
Copy link
Copy Markdown
Contributor

@dionboles-asym dionboles-asym commented Nov 27, 2023

I removed the usage of "show_term_count" and replaced it with "show_counts" to restore the expected values according to the documentation. Moreover, I updated the "paginator" and "get all" functions to accept "show_counts" as a parameter and return the appropriate values for unique terms. Additionally, I introduced the "get_count" and "set_count" functions to the Q class. These functions allow setting the state of the Qconfig to be passed to the next Q call.

dionboles-asym and others added 2 commits November 22, 2023 13:24
… pagination bug (#221)

* Updated unique terms to work with previous functionality, and fixed a pagination bug

* updated test with new name and removed commented code

* remove the test on remote

* Updated descriptions for unique terms

* updated show_counts to state that is nonfunctional
…t back to the expected values from the documentation. Additionally, updated the "paginator" and "get all" functions to accept "show_counts" and return the proper values for unique terms
Comment thread tests/test_unique_terms_page_bug.py Outdated
from tests.global_settings import host


# TODO debug paginator not returning show_counts with unique_terms
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.

Is this TODO still relevant with the test on line 15?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope i forgot to remove it

Comment thread cdapython/utils/utility.py Outdated
verbose: bool = True,
limit: int = 100,
) -> Paged_Result:
# TODO : Should the value be changed? The "show_counts" parameter was copied from Swagger-generated code. Is this description sufficient?
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.

This TODO should be removed, right?

Args:
col_name (str): _description_
system (str, optional): _description_. Defaults to "".
col_name (str): This is the default way to search for a unique term from the CDA service API.
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.

Thanks for filling out the docstring! It's been very helpful to guide our conversations.

Comment thread cdapython/results/page_result.py Outdated
to_df (bool, optional): _description_. Defaults to False.
to_list (bool, optional): _description_. Defaults to False.
show_term_count (bool, optional): _description_. Defaults to False.
show_counts (bool, optional): _description_. Defaults to False.
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.

docstring needs to be updated.

async_req: bool,
include_total_count: bool,
show_term_count: Optional[bool],
show_counts: Optional[bool],
Copy link
Copy Markdown
Contributor

@otchet-broad otchet-broad Nov 27, 2023

Choose a reason for hiding this comment

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

two questions:

  1. Is this needed on this factory or the other domain-type factories? (mutations, research_subject, subject, etc?). Do we use this value?
  2. Doc string at line 33 is incorrect and needs updating.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the factory, it is necessary to match the number of parameters in Q's 'Q._call_endpoint', which is currently being overrated by the factories. show in this error from pylint if show_counts is removed i can use a _ if we don't want to use show_counts Number of parameters was 8 in 'Q._call_endpoint' and is now 7 in overriding 'BooleanQuery._call_endpoint

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.

Right. Thanks for reminding me about the Q._call_endpoint.

The docstring below at line 33 needs updating.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants