Skip to content

Commit

Permalink
Merge pull request #601 from MetRonnie/mypy
Browse files Browse the repository at this point in the history
Address mypy error
  • Loading branch information
oliver-sanders authored Jun 18, 2024
2 parents d591ef2 + 713a23a commit 4d54725
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cylc/uiserver/data_store_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from copy import deepcopy
from pathlib import Path
import time
from typing import Dict, Optional, Set
from typing import TYPE_CHECKING, Dict, Optional, Set, cast

from cylc.flow.exceptions import WorkflowStopped
from cylc.flow.id import Tokens
Expand All @@ -56,6 +56,9 @@
from .utils import fmt_call
from .workflows_mgr import workflow_request

if TYPE_CHECKING:
from cylc.flow.data_messages_pb2 import PbWorkflow


def log_call(fcn):
"""Decorator for data store methods we want to log."""
Expand Down Expand Up @@ -408,7 +411,7 @@ async def _entire_workflow_update(
new_data = deepcopy(DATA_TEMPLATE)
for field, value in pb_data.ListFields():
if field.name == WORKFLOW:
new_data[field.name].CopyFrom(value)
cast('PbWorkflow', new_data[field.name]).CopyFrom(value)
new_data['delta_times'] = {
key: value.last_updated
for key in DATA_TEMPLATE
Expand Down

0 comments on commit 4d54725

Please sign in to comment.