Skip to content

Commit

Permalink
Add model_rebuild for job models
Browse files Browse the repository at this point in the history
  • Loading branch information
cjh1 committed Apr 10, 2024
1 parent 284acda commit 376fe1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sfapi_client/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,9 @@ def resources(self) -> AsyncResources:
AsyncRemotePath.model_rebuild()
AsyncRole.model_rebuild()
AsyncGroupMember.model_rebuild()

# Ensure that the job models are built, we need to import here to
# avoid circular imports
from .jobs import AsyncJobSacct, AsyncJobSqueue
AsyncJobSqueue.model_rebuild()
AsyncJobSacct.model_rebuild()
6 changes: 6 additions & 0 deletions src/sfapi_client/_sync/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,9 @@ def resources(self) -> Resources:
RemotePath.model_rebuild()
Role.model_rebuild()
GroupMember.model_rebuild()

# Ensure that the job models are built, we need to import here to
# avoid circular imports
from .jobs import JobSacct, JobSqueue
JobSqueue.model_rebuild()
JobSacct.model_rebuild()

0 comments on commit 376fe1f

Please sign in to comment.