Attribute error fix for retry policy #1322
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With the current release, python worker was failing with the following error
Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException : Result: Failure Exception: AttributeError: 'Function' object has no attribute 'get_settings_dict' Stack: File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 345, in _handle__functions_metadata_request fx_metadata_results = self.index_functions(function_path) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py', line 622, in index_functions fx_metadata_results = loader.process_indexed_function( File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py', line 109, in process_indexed_function retry_protos = build_retry_protos(indexed_function) File '/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py', line 69, in build_retry_protos retry = indexed_function.get_settings_dict(RETRY_POLICY)
This error is caused in dedicated due the python worker using the library that the customer brings in. To fix this error we check if the get_settings_api attribute exists and then proceed with retry policy else set retry policy to None
Fixes #
PR information
Quality of Code and Contribution Guidelines