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

Test implement sdk #2824

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Test implement sdk #2824

wants to merge 5 commits into from

Conversation

bloodbare
Copy link
Contributor

Description

Describe the proposed changes made in this PR.

How was this PR tested?

Describe how you tested this PR.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.79%. Comparing base (506950f) to head (297f157).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2824      +/-   ##
==========================================
- Coverage   86.80%   86.79%   -0.02%     
==========================================
  Files         380      380              
  Lines       23872    23839      -33     
==========================================
- Hits        20723    20690      -33     
  Misses       3149     3149              
Flag Coverage Δ
nucliadb 75.34% <ø> (+0.02%) ⬆️
nucliadb-ingest 40.95% <ø> (ø)
nucliadb-reader 42.75% <ø> (+0.01%) ⬆️
nucliadb-search 44.20% <ø> (-0.01%) ⬇️
nucliadb-standalone 47.37% <ø> (-0.01%) ⬇️
nucliadb-train 45.52% <ø> (-0.01%) ⬇️
nucliadb-writer 46.82% <ø> (-0.02%) ⬇️
nucliadb_models 85.78% <ø> (ø)
nucliadb_telemetry 86.56% <ø> (ø)
nucliadb_utils 83.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.



def ask_response_parser(response: httpx.Response) -> SyncAskResponse:
def ask_response_parser(response_type: Type[BaseModel], response: httpx.Response) -> BaseModel:
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need to pass response_type as a parameter here? isn't it always SyncAskResponse?
I think the return type of this function should be SyncAskResponse.

And also, for the async version, I think we shuld be iterating the response asynchronously no? (that wasnt implemented before either)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not changing the API SDK behavior on this PR, just fixing the typing. Can not be SyncAskResponse because the Generic is bound to BaseModel.

Copy link
Contributor

@lferran lferran left a comment

Choose a reason for hiding this comment

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

Great improvement! finally this will fix the problems we had with typings.
Left a few comments

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.

2 participants