-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Type hint errors #111
Comments
Thanks, will take a look at those tomorrow morning 👍 |
Branch 111-type_hint_errors created! |
After refactoring, I remember why I did this with these pieces, its due to the way MyPy reads a Union, it will error if the response is anything other than the union, even though we would expect it to accept either an int or str. it makes sense as you are saying it could be either a str or an int, but im currently looking at a way around this, possibly with
seems others had this issue: |
Yes I'm pretty sure the only way is to do an |
Mostly unrelated to this, I think there's a mixup between using |
Ah, one last thing. |
Branch 111-type_hint_errors created! |
Yes I agree there are some consistency issues with the naming of args etc. I will go through this at some point. However based on this I think the next think I look into will be setting up tests, not something ive done before but think it is necessary to avoid a lot of these issues. |
Dropped v4.0.1 into my project, and decided to see what Pylance says doesn't work.
RadarrAPI.add_movie
should take adb_id: Union[str, int]
since IMDB IDs arestr
s and TMDB IDs areint
s (or at least those are the types returned byRadarrAPI.lookup_movie
). This propagates toRadarrAPI._movie_json
andRadarrAPI.lookup_movie_by_tmdb_id
.RadarrAPI.get_tag_detail
should returnUnion[list[dict[str, Any]], dict[str, Any]]
since as the docstring points out, "Returns all tags or specific tag by database id with detailed information".SonarrAPI.get_series
should returnUnion[list[dict[str, Any]], dict[str, Any]]
: "Returns all series in your collection or the series with the matching series ID if one is found."Also, to import
RadarrCommands
, should that be exposed at the top levelpyarr
package? Having to dofrom pyarr.models.radarr import RadarrCommands
seems a bit esoteric (as well asSonarrCommands
).The text was updated successfully, but these errors were encountered: