-
Notifications
You must be signed in to change notification settings - Fork 7
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
Code review #14
Comments
Not much to add myself. zoom-drive-connector/drive/drive_api.py Line 42 in 00e4c10
We might want to use the same bin/git and style_check.sh /.pylintrc /.pycodestyle as in the other repositories.Lots of typing with list , dict , etc., but normally you would use typing's List and Dict etc.
Maybe run:
to get a more reproducible set of dependencies (with versions). From a security perspective, I don't know if it is great to have a plain readable |
Thanks for the comments, everyone. Most of this stuff should be fairly easy to fix, though I have a couple of comments.
@kracekumar I generally like to avoid namedtuples due to performance considerations (slow startup times). This is a fairly small application so it wouldn't matter here, but it's a practice I like to follow. In terms of docstrings, I've been writing them in reStructured Text format (as recommended by PEP 287). The reason for this is that this repository was started before we had a stated company-wide docstring format. As a consequence, most of the Python code written by IT uses this format now. I think this is part of a bigger discussion on whether to migrate IT's docstring formatting to something else. @jvanheugten In terms of having access keys and credentials in a file, there's a tradeoff to be made here: either keeping everything on disk or using environment variables (which get logged in your shell history anyway). The configuration file will likely be in someone's home folder which should only be accessible by one person. |
So here's a preliminary todo list. Feel free to comment on this so I can add stuff.
|
@jbedorf and @MrFlynn. The overall code looks good. There are few minor suggested changes by me. @jvanheugten please add your reviews too. Please feel to modify or ignore. Though, I haven't tested the workflow by setting up the repo.
Typing
List[Dict[str, str]]
. If you find difficult to annotate a dict, consider using namedtuple.Dict[]
and notdict
.date
andfilename
in the dictionary can be None on failure, and helps to maintain the same structure.Requests
the above code can be written as
Response API: http://docs.python-requests.org/en/master/api/#requests.Response
General
'HTTP_STATUS: {c}-{n}, {m}'.format(c=self.status_code, n=self.name, m=self.message)
rather than format string you can consider using f-string likef'HTTP_STATUS: {self.status_code}-{self.name}, {self.message}'
.__repr__
prints object creation method likePipeline(steps=[(a, A())])
. https://docs.python.org/3/library/functions.html#repr. https://github.com/minds-ai/zoom-drive-connector/blob/master/zoom/zoom_api_exception.py#L47this repo follows
The advantage of the method is, when zoom changes it's API, we can find all the URLS in one place and modify.
Typos
entries
is misspelled asentrees
in README.Testing
We can write unit tests for the code, we have written like ConfigParsers and other services specific code. One can mock the request, and response using Python Mock library, Responses. Once you have a list of scenarios like
Zoom recording file is missing
,record files are available
then write tests for specific code parts.The text was updated successfully, but these errors were encountered: