Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions basyx/aas/backend/couchdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""
import threading
import weakref
from typing import List, Dict, Any, Optional, Iterator, Iterable, Union, Tuple
from typing import List, Dict, Any, Optional, Iterator, Iterable, Union, Tuple, MutableMapping
import urllib.parse
import urllib.request
import urllib.error
Expand Down Expand Up @@ -108,7 +108,7 @@ def _parse_source(cls, source: str) -> str:

@classmethod
def do_request(cls, url: str, method: str = "GET", additional_headers: Dict[str, str] = {},
body: Optional[bytes] = None) -> Dict[str, Any]:
body: Optional[bytes] = None) -> MutableMapping[str, Any]:
Copy link
Copy Markdown
Contributor Author

@JGrothoff JGrothoff Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the return type to the more generic MutableMappingwe could also add HTTPHeaderDict as Union.
Alternatively we can leave Dict return type and transform the response.headers into a normal dict in line 158. However this produces additional overhead, e.g.:
return {key: value for key, value in response.headers.items()}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinion on which type should be used here.

"""
Perform an HTTP(S) request to the CouchDBServer, parse the result and handle errors

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ requires-python = ">=3.8"
dependencies = [
"python-dateutil>=2.8,<3",
"lxml>=4.2,<5",
"urllib3>=1.26,<2.0",
"urllib3>=1.26,<3",
"pyecma376-2>=0.2.4"
]

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lxml>=4.2,<5
python-dateutil>=2.8,<3.0
types-python-dateutil
pyecma376-2>=0.2.4
urllib3>=1.26,<2.0
urllib3>=1.26,<3
Werkzeug>=3.0.3,<4
schemathesis~=3.7
hypothesis~=6.13
Expand Down