Skip to content

Commit

Permalink
Refactor imports to troubleshoot circular import exception noted in h…
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Nov 19, 2024
1 parent a278b19 commit 02697ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions neon_data_models/models/base/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from datetime import datetime, timedelta
from typing import Literal, List, Optional

from pydantic import Field

from neon_data_models.models.base import BaseModel


Expand Down
8 changes: 6 additions & 2 deletions neon_data_models/models/base/messagebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
from neon_data_models.models.base import BaseModel
from neon_data_models.models.base.contexts import (SessionContext, KlatContext,
TimingContext, MQContext)
from neon_data_models.models.client import NodeData
from neon_data_models.models.user import NeonUserConfig


class MessageContext(BaseModel):
from neon_data_models.models.client.node import NodeData
from neon_data_models.models.user.database import NeonUserConfig

model_config = ConfigDict(extra="allow")
session: Optional[SessionContext] = Field(description="Session Data",
default=None)
Expand Down Expand Up @@ -63,3 +64,6 @@ class BaseMessage(BaseModel):
msg_type: str
data: dict
context: MessageContext


__all__ = [MessageContext.__name__, BaseMessage.__name__]
5 changes: 2 additions & 3 deletions neon_data_models/models/user/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@
from typing import Dict, Any, List, Literal, Optional
from typing_extensions import deprecated
from uuid import uuid4

from neon_data_models.models.api.jwt import HanaToken
from neon_data_models.models.base import BaseModel
from pydantic import Field
from datetime import date

from neon_data_models.enum import AccessRoles
from neon_data_models.models.api.jwt import HanaToken
from neon_data_models.models.base import BaseModel


class _UserConfig(BaseModel):
Expand Down
2 changes: 0 additions & 2 deletions neon_data_models/models/user/neon_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
import datetime

from typing import Optional, List, Literal

from pydantic import Field

from neon_data_models.models.base import BaseModel

from neon_data_models.models.user.database import User


Expand Down

0 comments on commit 02697ee

Please sign in to comment.