-
Notifications
You must be signed in to change notification settings - Fork 107
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
[BUG] Using modern python types instead of typing.XXX with queue output binding #1176
Comments
Thanks for update will update on this asap. |
@bp instance for which function instance created? is it from flask import Blueprint |
Ah, sorry, yes. This is the blueprint |
can you share zip file for the same |
from your error msg it suggest that the problem is with the issubclass() method, which expects the first argument to be a class. This indicates that the list class is not being recognized as a valid type for the output binding. To fix this, you can try using typing.List[str] instead of list[str] for the output binding type annotation. This should resolve the error and allow you to use the correct type annotation for the output binding. Here's an example of how to use typing.List[str] for the output binding type annotation: def main(req: func.HttpRequest, outputQueueItem: func.Out[typing.List[str]]) -> func.HttpResponse:
I hope this helps and Meanwhile you can share your solution with zip file. |
@madhankumar1984 pls update with your file. |
It is related to #1034 - Needs investigation. |
@kummerer94 Currently the python worker does not support type hinting. We are working on getting that support in. Updates on this will be tracked in #1034 |
Investigative information
Hi, I think the queue output binding does not yet play nice with the modern type declarations that are part of newer python models.
Repro steps
I tried using
func.Out[list[str]]
for my output binding instead offunc.Out[typing.List[str]]
and it gave me this error:I am using the new python programming model v2.
To reproduce this, I am using the following function:
Known workarounds
Right now, the workaround is to use the
List
class provided by thetyping
module. But more and more people are moving away from using thetyping
module because it is not necessary anymore.For now, it would also be great to make this error more descriptive as it took me some time to figure out what was going on.
The text was updated successfully, but these errors were encountered: