Skip to content

Commit

Permalink
Revert "Alternative fix for providing a Result's issues"
Browse files Browse the repository at this point in the history
This reverts commit 42d6ee4.
  • Loading branch information
alessiostalla committed Nov 21, 2023
1 parent 42d6ee4 commit a56caa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 3 additions & 4 deletions pylasu/astruntime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@


def unserialize_result(json_result, root_unserializer) -> Result:
return Result(
root=root_unserializer(json_result['root']) if 'root' in json_result else None,
issues=[unserialize_issue(issue) for issue in json_result['issues']] if 'issues' in json_result else []
)
result = Result(root=root_unserializer(json_result['root']) if 'root' in json_result else None)
result.issues = [unserialize_issue(issue) for issue in json_result['issues']] if 'issues' in json_result else []
return result


def unserialize_issue(json_issue) -> Issue:
Expand Down
7 changes: 1 addition & 6 deletions pylasu/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ class WithIssues:
issues: List[Issue] = field(default_factory=list, init=False)


@dataclass(init=False)
@dataclass
class Result(WithIssues):
root: Node

def __init__(self, root: Node, issues: List[Issue] = None):
self.root = root
if issues:
self.issues = issues

0 comments on commit a56caa4

Please sign in to comment.