You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
[FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
Please do not modify this template :) and fill in all the required fields.
Dify version
master
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
the violation in mypy checks:
extensions/storage/azure_blob_storage.py:25: error: Incompatible types in assignment (expression has type "None", variable has type "DefaultAzureCredential") [assignment]
extensions/storage/azure_blob_storage.py:67: error: Argument "account_url" to "BlobServiceClient" has incompatible type "str | None"; expected "str" [arg-type]
Found 2 errors in 1 file (checked 952 source files)
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered:
The mypy errors you're encountering in the azure_blob_storage.py file are related to type mismatches. Here's how you can address them:
Incompatible types in assignment (line 25):
The error indicates that None is being assigned to a variable expected to be of type DefaultAzureCredential. To resolve this, ensure that self.credential is always assigned a DefaultAzureCredential or handle the None case appropriately. You might need to adjust the type hint for self.credential to allow None if it's a valid state, like this:
Incompatible type for account_url (line 67):
The error suggests that account_url is expected to be a string, but it might be None. Ensure that dify_config.AZURE_BLOB_ACCOUNT_URL is always a string. If it can be None, you should handle this case before passing it to BlobServiceClient. For example:
ifself.account_urlisnotNone:
self.blob_service_client=BlobServiceClient(account_url=self.account_url, credential=self.credential)
else:
# Handle the None case appropriately
By ensuring that the types match the expected types, you should be able to resolve these mypy errors.
Self Checks
Dify version
master
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: