From d84438fd534338addd5f0492ad88936c56544950 Mon Sep 17 00:00:00 2001 From: newyangyang Date: Thu, 23 Apr 2026 20:40:54 +0800 Subject: [PATCH] fix azure blob put method param (#14329) ### What problem does this PR solve? when use azure blob as the file container, when click parse file, it calls: ```python partial(settings.STORAGE_IMPL.put, tenant_id=task["tenant_id"]) ``` So any storage backend used there must accept tenant_id as a kwarg. RAGFlowAzureSasBlob.put() did not, causing: ``` TypeError: ... got an unexpected keyword argument 'tenant_id' ``` Now it does, so parsing should proceed past this point. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/utils/azure_sas_conn.py | 2 +- rag/utils/azure_spn_conn.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/utils/azure_sas_conn.py b/rag/utils/azure_sas_conn.py index bb0062309f..78edc458c3 100644 --- a/rag/utils/azure_sas_conn.py +++ b/rag/utils/azure_sas_conn.py @@ -51,7 +51,7 @@ class RAGFlowAzureSasBlob: _bucket, fnm, binary = "txtxtxtxt1", "txtxtxtxt1", b"_t@@@1" return self.conn.upload_blob(name=fnm, data=BytesIO(binary), length=len(binary)) - def put(self, bucket, fnm, binary): + def put(self, bucket, fnm, binary, tenant_id=None): for _ in range(3): try: return self.conn.upload_blob(name=fnm, data=BytesIO(binary), length=len(binary)) diff --git a/rag/utils/azure_spn_conn.py b/rag/utils/azure_spn_conn.py index 4cfaa0f3e7..418b3ee6af 100644 --- a/rag/utils/azure_spn_conn.py +++ b/rag/utils/azure_spn_conn.py @@ -68,7 +68,7 @@ class RAGFlowAzureSpnBlob: f.append_data(binary, offset=0, length=len(binary)) return f.flush_data(len(binary)) - def put(self, bucket, fnm, binary): + def put(self, bucket, fnm, binary, tenant_id=None): for _ in range(3): try: f = self.conn.create_file(fnm)