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

hacktoberfest - Added a get all results function #1840

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Smartmind12
Copy link

The get_all_results() function to retrieve all results, optionally filtered by a list of dispatch IDs, statuses, and timestamps. This provides more flexibility and control over the results you want to retrieve.

Could potentially close #1701

  • I have added the tests to cover my changes.
  • I have updated the documentation and CHANGELOG accordingly.
  • I have read the CONTRIBUTING document.

@Smartmind12 Smartmind12 requested a review from a team as a code owner October 23, 2023 03:34
@CLAassistant
Copy link

CLAassistant commented Oct 23, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Hello. You may have forgotten to update the changelog!
Please edit CHANGELOG.md with a one-to-two sentence description of the change in the UNRELEASED section. You may include a small working example for new features.

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #1840 (7e39667) into develop (889bf3e) will decrease coverage by 1.80%.
Report is 28 commits behind head on develop.
The diff coverage is 92.27%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1840      +/-   ##
===========================================
- Coverage    80.17%   78.38%   -1.80%     
===========================================
  Files          232      128     -104     
  Lines        10239     7300    -2939     
  Branches       193        0     -193     
===========================================
- Hits          8209     5722    -2487     
+ Misses        1897     1578     -319     
+ Partials       133        0     -133     
Flag Coverage Δ *Carryforward flag
Dispatcher 82.15% <ø> (-4.22%) ⬇️ Carriedforward from 889bf3e
Functional_Tests ?
SDK 77.38% <92.27%> (+2.55%) ⬆️
UI_Backend ?
UI_Frontend ?

*This pull request uses carry forward flags. Click here to find out more.

@Smartmind12
Copy link
Author

Smartmind12 commented Oct 29, 2023

Hey @Andrew-S-Rosen @wjcunningham7 Kindly review this PR that closes the above issue!

@wjcunningham7
Copy link
Member

wjcunningham7 commented Oct 30, 2023

Hi @Smartmind12 thanks for the PR. There are few changes needed before we can accept it.

In your implementation you assume the Covalent server is running locally and directly interact with the results directory. This pattern is discouraged, in favor of an API-based approach. The client method in the Covalent SDK (/covalent) should call an API defined in the Covalent Dispatcher (/covalent_dispatcher/_service/app.py). Further, you'll want to apply filtering on the server side rather than the client side. This amounts to adding a batch-get version of the route /api/v2/dispatches/:dispatch_id, such as /api/v2/dispatches where filters are applied as query strings. Finally, any batch-get response should include pagination.

An example of a similar route can also be found in the front-end code, since the Covalent dashboard also performs a batch-get of dispatches (see /covalent_ui/api/v1/routes/end_points/summary_routes.py)

Copy link
Member

@wjcunningham7 wjcunningham7 left a comment

Choose a reason for hiding this comment

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

See other comment

@santoshkumarradha santoshkumarradha added the stale An old issue or pull request which must be resolved label Dec 7, 2023
Copy link

@adirao-projects adirao-projects left a comment

Choose a reason for hiding this comment

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

I'm not sure if ct would be defined inside this function as ct (I'm assuming) is the covalent package itself. Different implementation is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale An old issue or pull request which must be resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding a ct.get_all_results() function
5 participants