-
Notifications
You must be signed in to change notification settings - Fork 28
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
validate existing type annotations #353
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding all these types! I had a question about one parameter and a concern about interpreting binary contents.
@@ -67,11 +67,11 @@ class ProfileManager: | |||
""" | |||
|
|||
def __init__(self, appname: Optional[str] = "zowe", show_warnings: Optional[bool] = True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If appname
is Optional[str]
but has a default value, could the type be updated to str
? If not feel free to disregard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can, thanks for pointing this out. I've updated the type from Optional[str]
to str
return { | ||
"content_type": response.headers.get("Content-Type"), | ||
"content_length": len(response.content), | ||
"file_content": response.content.decode("utf-8", errors="ignore") # You can also base64-encode this if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it could break output for binary files because even though the content is binary, we try to decode the response content as UTF-8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is true. we could avoid directly decoding binary content as UTF-8, so i base64-encode the binary data.
c07cc2b
to
4e643a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the overall goal makes sense to me 😋
However, there are a few things that I'm not sure that's exactly they should be done. 😋
Left some comments since I'm not able to run unit (nor integration) tests successfully in this PR 😢
from .console import ConsoleResponse, IssueCommandResponse | ||
from .console_response import ConsoleResponse | ||
from .issue_response import IssueCommandResponse | ||
|
||
__all__= ["ConsoleResponse", "IssueCommandResponse"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't claim to be an expert on how this all works, but where is .issue_response
?
I'm afraid I can't get the unit tests to run because of this (and many similar changes) 🤔
@@ -17,6 +17,7 @@ | |||
from .logger import Log | |||
from .request_handler import RequestHandler | |||
from .session import ISession, Session | |||
from typig import Dict, Any, Optional, Type, Union |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typig import Dict, Any, Optional, Type, Union | |
from typing import Dict, Any, Optional, Type, Union |
@@ -11,4 +11,6 @@ | |||
""" | |||
from .datasets import DatasetListResponse, MemberListResponse | |||
from .file_system import FileSystemListResponse | |||
from .uss import USSListResponse | |||
from .uss_response import USSListResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from .uss_response import USSListResponse | |
from .uss import USSListResponse |
from .jobs import JobResponse, SpoolResponse, StatusResponse | ||
from .job_response import JobResponse | ||
from .spool_response import SpoolResponse | ||
from .status_response import StatusResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we might want to refer these changes 😋
4e643a4
to
9405b81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like some items have not been resoled yet.
Please check them out before re-requesting review 🙏
Signed-off-by: Olamide Ojo <peterojoolamide@gmail.com>
9405b81
to
ef18862
Compare
Not sure if the re-request is happening automatically because of the force-push 😓 For now, I'll remove myself from the list of reviewers on this PR 🙏 |
@zFernand0 my apologies. haha, ive been the one re-requesting review. could you please point out the few issues you noticed cause the ones mentioned earlier has been solved |
Fixes #321
How to Test
Review Checklist
I certify that I have:
Additional Comments