Azure / Azure/Azure-Functions

Google BigQuery Python Client Issue in Azure Function

Open
#2,245 1 comment 0 reactions 1 assignee Claimed by @Ved2806 View on GitHub
bug Needs: Attention :wave:
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I am getting an error when trying to import the Google BigQuery Python Client in an Azure Function. This works fine if I test somewhere else like a local script or Jupyter Notebook.

Importing the following to the out of the box Http Trigger function:
`from google.cloud import bigquery`

Leads to this error:

```
[2022-08-02T21:01:52.607] Worker failed to function id ec06ba50-3e6a-4352-84a9-7376e440da11.
[2022-08-02T21:01:52.608] Result: Failure
Exception: AttributeError: 'NoneType' object has no attribute 'message_types_by_name'
Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.8/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 262, in _handle__function_load_request
func = loader.load_function(
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.8/WINDOWS/X64\azure_functions_worker\utils\wrappers.py", line 32, in call
return func(*args, **kwargs)
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.8/WINDOWS/X64\azure_functions_worker\loader.py", line 76, in load_function
mod = importlib.import_module(fullmodname)
File "C:\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\Users\admin\Desktop\TestFuncApp\TestHttpTrigger\__init__.py", line 5, in
from google.cloud import bigquery
File "c:\Users\admin\Desktop\TestFuncApp\.venv\lib\site-packages\google\cloud\bigquery\__init__.py", line 35, in
from google.cloud.bigquery.client import Client
File "c:\Users\admin\Desktop\TestFuncApp\.venv\lib\site-packages\google\cloud\bigquery\client.py", line 52, in
import google.api_core.exceptions as core_exceptions
File "c:\Users\admin\Desktop\TestFuncApp\.venv\lib\site-packages\google\api_core\exceptions.py", line 29, in
from google.rpc import error_details_pb2
File "c:\Users\admin\Desktop\TestFuncApp\.venv\lib\site-packages\google\rpc\error_details_pb2.py", line 39, in
_RETRYINFO = DESCRIPTOR.message_types_by_name["RetryInfo"]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.