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

Fix return type of resource enter protocol in DaprGrpcClient. Fixes #520 #521

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

dbrattli
Copy link
Contributor

@dbrattli dbrattli commented Jan 7, 2023

Description

Fixes return type of DaprGrpcClient so that sub-classes i.e DaprClient gets the right type back when doing with DaprClient as d.

Note that mypy does not currently handle the Self type python/mypy#14089 so we need a new version of mypy for this to work. Current version of mypy gives: Variable "typing_extensions.Self" is not valid as a type [valid-type]. To make it work I've added # type: ignore on the line which seems to work with both current version of mypy and sub-classes gets the right type with type checkers such as pyright.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #520

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests (not needed)
  • Extended the documentation (not needed)

@dbrattli dbrattli requested review from a team as code owners January 7, 2023 15:07
Copy link
Member

@berndverst berndverst 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 to me. Thanks for the contribution.

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #521 (531014d) into master (edff0ff) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #521   +/-   ##
=======================================
  Coverage   89.82%   89.82%           
=======================================
  Files          57       57           
  Lines        2613     2614    +1     
=======================================
+ Hits         2347     2348    +1     
  Misses        266      266           
Impacted Files Coverage Δ
dapr/clients/grpc/client.py 90.65% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@berndverst berndverst added this to the v1.9 milestone Jan 11, 2023
@berndverst berndverst merged commit 823ad49 into dapr:master Jan 11, 2023
tmacam added a commit to tmacam/dapr-python-sdk that referenced this pull request Mar 20, 2023
PR dapr#521 added an implicit dependency on `typing-extensions`. During development this dependency is satisfied as it is mentioned on `dev-requirements.txt`. However, new instalations of the Python SDK will not bring this pendency and applications depending on `dapr.client.DaprClient` will fail to load with an import exception.

This PR addresses this by adding `typing-extensions` to the dependency list of the generated python sdk package.

Closes dapr#544
tmacam added a commit to tmacam/dapr-python-sdk that referenced this pull request Mar 20, 2023
PR dapr#521 added an implicit dependency on `typing-extensions`. During development this dependency is satisfied as it is mentioned on `dev-requirements.txt`. However, new instalations of the Python SDK will not bring this pendency and applications depending on `dapr.client.DaprClient` will fail to load with an import exception.

This PR addresses this by adding `typing-extensions` to the dependency list of the generated python sdk package.

Closes dapr#544

Signed-off-by: Tiago Alves Macambira <[email protected]>
berndverst pushed a commit that referenced this pull request Mar 21, 2023
PR #521 added an implicit dependency on `typing-extensions`. During development this dependency is satisfied as it is mentioned on `dev-requirements.txt`. However, new instalations of the Python SDK will not bring this pendency and applications depending on `dapr.client.DaprClient` will fail to load with an import exception.

This PR addresses this by adding `typing-extensions` to the dependency list of the generated python sdk package.

Closes #544

Signed-off-by: Tiago Alves Macambira <[email protected]>
berndverst pushed a commit to berndverst/python-sdk that referenced this pull request Mar 21, 2023
PR dapr#521 added an implicit dependency on `typing-extensions`. During development this dependency is satisfied as it is mentioned on `dev-requirements.txt`. However, new instalations of the Python SDK will not bring this pendency and applications depending on `dapr.client.DaprClient` will fail to load with an import exception.

This PR addresses this by adding `typing-extensions` to the dependency list of the generated python sdk package.

Closes dapr#544

Signed-off-by: Tiago Alves Macambira <[email protected]>
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.

The DaprClient resource manager returns wrong type
2 participants