Skip to content

Commit b667426

Browse files
committed
fix: cyclic import
1 parent 173297f commit b667426

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Shared exceptions that don't belong to a single utility"""
2+
3+
4+
class InvalidEnvelopeExpressionError(Exception):
5+
"""When JMESPath fails to parse expression"""

aws_lambda_powertools/shared/jmespath_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import base64
22
import gzip
33
import json
4+
import logging
45
from typing import Any, Dict, Optional, Union
56

67
import jmespath
78
from jmespath.exceptions import LexerError
89

9-
from aws_lambda_powertools.utilities.validation import InvalidEnvelopeExpressionError
10-
from aws_lambda_powertools.utilities.validation.base import logger
10+
from aws_lambda_powertools.exceptions import InvalidEnvelopeExpressionError
11+
12+
logger = logging.getLogger(__name__)
1113

1214

1315
class PowertoolsFunctions(jmespath.functions.Functions):
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from ...exceptions import InvalidEnvelopeExpressionError
2+
3+
14
class SchemaValidationError(Exception):
25
"""When serialization fail schema validation"""
36

@@ -6,5 +9,4 @@ class InvalidSchemaFormatError(Exception):
69
"""When JSON Schema is in invalid format"""
710

811

9-
class InvalidEnvelopeExpressionError(Exception):
10-
"""When JMESPath fails to parse expression"""
12+
__all__ = ["SchemaValidationError", "InvalidSchemaFormatError", "InvalidEnvelopeExpressionError"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pydantic = ["pydantic", "email-validator"]
6060

6161
[tool.coverage.run]
6262
source = ["aws_lambda_powertools"]
63-
omit = ["tests/*"]
63+
omit = ["tests/*", "aws_lambda_powertools/exceptions/*"]
6464
branch = true
6565

6666
[tool.coverage.html]

0 commit comments

Comments
 (0)