Skip to content

Commit

Permalink
fix FURB189
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Nov 14, 2024
1 parent 5fb76e8 commit 6c09c3e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import random
from collections import UserDict
from datetime import datetime


Expand All @@ -10,7 +11,7 @@ class ChatRole:
FUNCTION = "function"


class _Dict(dict):
class _Dict(UserDict):
__setattr__ = dict.__setitem__
__getattr__ = dict.__getitem__

Expand Down
3 changes: 2 additions & 1 deletion api/tests/integration_tests/vdb/__mock/baiduvectordb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from collections import UserDict
from unittest.mock import MagicMock

import pytest
Expand All @@ -11,7 +12,7 @@
from requests.adapters import HTTPAdapter


class AttrDict(dict):
class AttrDict2(UserDict):
def __getattr__(self, item):
return self.get(item)

Expand Down
3 changes: 2 additions & 1 deletion api/tests/integration_tests/vdb/__mock/upstashvectordb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from collections import UserDict
from typing import Optional

import pytest
Expand Down Expand Up @@ -50,7 +51,7 @@ def info(self):
return AttrDict({"dimension": 1024})


class AttrDict(dict):
class AttrDict(UserDict):
def __getattr__(self, item):
return self.get(item)

Expand Down
3 changes: 2 additions & 1 deletion api/tests/unit_tests/oss/__mock/volcengine_tos.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from collections import UserDict
from unittest.mock import MagicMock

import pytest
Expand All @@ -14,7 +15,7 @@
)


class AttrDict(dict):
class AttrDict(UserDict):
def __getattr__(self, item):
return self.get(item)

Expand Down

0 comments on commit 6c09c3e

Please sign in to comment.