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

Add plugin clients typing to the opensearch client #440

Closed
wants to merge 1 commit into from
Closed

Add plugin clients typing to the opensearch client #440

wants to merge 1 commit into from

Conversation

florianvazelle
Copy link
Collaborator

Description

I add the clients of the various plugins to the typing of the main client (OpenSearch).

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #440 (00b0e34) into main (4dba35d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #440   +/-   ##
=======================================
  Coverage   71.49%   71.49%           
=======================================
  Files          81       81           
  Lines        7668     7668           
=======================================
  Hits         5482     5482           
  Misses       2186     2186           

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Looks good, update CHANGELOG?

Is there anything we can do to test this in a way that we don't forget next time?

@saimedhi
Copy link
Collaborator

Hello @florianvazelle, please respond to the following #399 (comment). Thanks

@florianvazelle florianvazelle marked this pull request as draft July 20, 2023 10:37
@saimedhi
Copy link
Collaborator

@florianvazelle, Could you please finish this PR when you have a moment? Thank you!

@florianvazelle
Copy link
Collaborator Author

florianvazelle commented Sep 6, 2023

Hi @saimedhi, sorry I'm taking some time to study solutions to have a correct stubs package.

The only real way I've found is to use stubtest, but that only ensures that the definitions in the stubs package are defined in the package at runtime too (no extra definitions) and logical with what is defined in the package at runtime (same parameters ...), but if a definition is missing in the stubs package it won't be raised.

I'm going to add this to the linting commands anyway.

To prevent oversights from happening again, I suggest opening a new issue to study solutions, and we'll can then merge this PR.

@dblock
Copy link
Member

dblock commented Nov 9, 2023

@florianvazelle I finished #536 so types are back in the game. Do you want to finish this?

I am not sure we need to declare types like this here. For other types we just do self.cat = CatClient(self) and I think the Python type system is smart enough to figure out that cat is always CatClient, but I could be wrong. So either add types as proposed here or remove the declaration?

@florianvazelle
Copy link
Collaborator Author

@dblock I think you fix my issue with #536, I'm closing this PR
thank you 😉

@florianvazelle florianvazelle deleted the fix-typing-for-client-plugins branch November 10, 2023 08:02
@dblock
Copy link
Member

dblock commented Nov 10, 2023

Did I? This code says Any, should it be typed or should the declaration be removed?

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