-
Notifications
You must be signed in to change notification settings - Fork 70
Fix return type signature for CNAME and SOA records #162
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 signature for CNAME and SOA records #162
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.
@bdraco can you also take a quick look?
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.
Looks good. Hopefully we can replace the Any someday with a base class is pycares.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #162 +/- ##
=======================================
Coverage 93.85% 93.85%
=======================================
Files 3 3
Lines 374 374
Branches 29 29
=======================================
Hits 351 351
Misses 14 14
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
If we wanted to be more specific than Any I think we could make something like this, though the Any is probably fine enough. I am not familiar enough with intrinsics of overload QueryResult = Union[
asyncio.Future[list[pycares.ares_query_a_result]],
asyncio.Future[list[pycares.ares_query_aaaa_result]],
asyncio.Future[list[pycares.ares_query_caa_result]],
asyncio.Future[pycares.ares_query_cname_result],
asyncio.Future[list[pycares.ares_query_mx_result]],
asyncio.Future[list[pycares.ares_query_naptr_result]],
asyncio.Future[list[pycares.ares_query_ns_result]],
asyncio.Future[list[pycares.ares_query_ptr_result]],
asyncio.Future[pycares.ares_query_soa_result],
asyncio.Future[list[pycares.ares_query_srv_result]],
asyncio.Future[list[pycares.ares_query_txt_result]],
] |
Technically, yes, but it'd be cleaner to define a base class in pycares with the common parts. |
What do these changes do?
Fixes the return type signature of DNSResolver query to not lie to users about what is returned. Properly reflects what Pycares actually returns for each query type.
Are there changes in behavior for the user?
Return type signature now matches reality of what is returned
Related issue number
Fixes #161
Checklist
Change does not change library functionality.