Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanBaker committed Feb 8, 2022
1 parent 92bfed2 commit 4cc11aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spectacles/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(
field_name: str,
message: str,
severity: str,
lookml_url: str,
lookml_url: Optional[str],
file_path: Optional[str],
line_number: Optional[int] = None,
):
Expand Down
5 changes: 2 additions & 3 deletions spectacles/validators/lookml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Any
from typing import Dict, Any, Optional
from spectacles.client import LookerClient
from spectacles.exceptions import LookMLError

Expand All @@ -25,6 +25,7 @@ def validate(self, project: str, severity: str = "warning") -> Dict[str, Any]:
severity_level = NAME_TO_LEVEL[severity]
validation_results = self.client.lookml_validation(project)
errors = []
lookml_url: Optional[str] = None
for error in validation_results["errors"]:
if error["file_path"]:
lookml_url = (
Expand All @@ -36,8 +37,6 @@ def validate(self, project: str, severity: str = "warning") -> Dict[str, Any]:
)
if error["line_number"]:
lookml_url += "?line=" + str(error["line_number"])
else:
lookml_url = None

lookml_error = LookMLError(
model=error["model_id"],
Expand Down

0 comments on commit 4cc11aa

Please sign in to comment.