Skip to content

Commit d84438f

Browse files
authored
fix azure blob put method param (infiniflow#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)
1 parent d4fa573 commit d84438f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

rag/utils/azure_sas_conn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def health(self):
5151
_bucket, fnm, binary = "txtxtxtxt1", "txtxtxtxt1", b"_t@@@1"
5252
return self.conn.upload_blob(name=fnm, data=BytesIO(binary), length=len(binary))
5353

54-
def put(self, bucket, fnm, binary):
54+
def put(self, bucket, fnm, binary, tenant_id=None):
5555
for _ in range(3):
5656
try:
5757
return self.conn.upload_blob(name=fnm, data=BytesIO(binary), length=len(binary))

rag/utils/azure_spn_conn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def health(self):
6868
f.append_data(binary, offset=0, length=len(binary))
6969
return f.flush_data(len(binary))
7070

71-
def put(self, bucket, fnm, binary):
71+
def put(self, bucket, fnm, binary, tenant_id=None):
7272
for _ in range(3):
7373
try:
7474
f = self.conn.create_file(fnm)

0 commit comments

Comments
 (0)