Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dataclass issues for Python 3.11 #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 transformer/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from requests.structures import CaseInsensitiveDict

import pendulum
from dataclasses import dataclass
from dataclasses import dataclass, field

from transformer.naming import to_identifier

Expand Down Expand Up @@ -118,7 +118,7 @@ class Request:
method: HttpMethod
url: SplitResult
har_entry: dict
headers: CaseInsensitiveDict = MappingProxyType({})
headers: CaseInsensitiveDict = field(default_factory=lambda: MappingProxyType({}))
post_data: Optional[dict] = None
query: List[QueryPair] = ()
name: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions transformer/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
)

import dataclasses
from dataclasses import dataclass
from dataclasses import dataclass, field
from requests.structures import CaseInsensitiveDict

import transformer.python as py
from transformer.denylist import on_denylist, Denylist, get_empty
from transformer.request import HttpMethod, Request, QueryPair

IMMUTABLE_EMPTY_DICT = MappingProxyType({})
IMMUTABLE_EMPTY_DICT = field(default_factory=lambda: MappingProxyType({}))
TIMEOUT = 30
ACTION_INDENTATION_LEVEL = 12
JSON_MIME_TYPE = "application/json"
Expand Down