-
Notifications
You must be signed in to change notification settings - Fork 58
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
_request_builder.py DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator #812
Comments
FYI, I discovered I could reduce (but not quite eliminate) the warnings by getting the classes from the "client" rather than importing them manually, e.g.:
Now I only get 5 (versus 7) warnings. The remainder feels more like a wart in the underlying code generation, than a bug in mine, so I won't spend any more time on this unless you have questions. Click to expand log``` /Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msal/token_cache.py:156: DeprecationWarning: Use list(search(...)) instead to explicitly get a list. warnings.warn(tests/test_graph.py::test_graph_get_users tests/test_graph.py::test_graph_get_users tests/test_graph.py::test_graph_get_users tests/test_sites.py::test_sites
|
Yep, this is annoying me too. |
Hello @drernie and @shaneseaton Thanks for using the SDK and for raising this. These changes occured during the move from V1.3.0 to V1.4.0 Part of the reason was to help with code quantity reduction and help us use more abstract classes for ease of customization. The PR on this is microsoft/kiota#4578 Note that you can use both the RequestBuilderConfiguration though deprecated, or the custome abstraction class as show in the PR. |
Simply just importing one of the class request builders is enough to trigger these warnings.
This is because the warnings are in the class scope, so will be ran at "compile" time.
|
Hi @shemogumbe can we reopen this issue, or should I create a new one? EDIT: See #965 |
Describe the bug
Maybe not an actual bug, but every time I use a
_request_builder
I get a warning like::943: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator
It appears I can use:
from kiota_abstractions.base_request_configuration import RequestConfiguration
But there doesn't seem to be any other way to get the
RequestBuilderGetQueryParameters
class other than by instantiating the specific version, e.g.UserItemRequestBuilder.UserItemRequestBuilderGetQueryParameters
.Expected behavior
Either:
How to reproduce
This showed up when pasting in code directly from the Tutorial:
https://learn.microsoft.com/en-us/graph/tutorials/python?tabs=aad&tutorial-step=4
SDK Version
1.5.2
Latest version known to work for scenario above?
No response
Known Workarounds
I can just ignore it...
Debug output
Click to expand log
``` ../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/kiota_abstractions/default_query_parameters.py:23 /Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/kiota_abstractions/default_query_parameters.py:23: DeprecationWarning: GetQueryParameters is deprecated. Use QueryParameters instead. warn("GetQueryParameters is deprecated. Use QueryParameters instead.", DeprecationWarning)../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/mail_folders/item/messages/messages_request_builder.py:208
/Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/mail_folders/item/messages/messages_request_builder.py:208: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/mail_folders/item/messages/messages_request_builder.py:215
/Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/mail_folders/item/messages/messages_request_builder.py:215: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/user_item_request_builder.py:910
/Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/user_item_request_builder.py:910: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/user_item_request_builder.py:943
/Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/user_item_request_builder.py:943: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/user_item_request_builder.py:950
/Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/users/item/user_item_request_builder.py:950: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
../../Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/sites/sites_request_builder.py:200
/Users/ernest/Library/Caches/pypoetry/virtualenvs/sharepoint-python-test-FDvtzw7U-py3.12/lib/python3.12/site-packages/msgraph/generated/sites/sites_request_builder.py:200: DeprecationWarning: This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
The text was updated successfully, but these errors were encountered: