File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/neo4j_graphrag/experimental/pipeline
tests/unit/experimental/pipeline Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 15
15
from __future__ import annotations
16
16
17
17
import asyncio
18
+ import datetime
18
19
import enum
19
20
import logging
20
21
import uuid
21
22
import warnings
22
23
from collections import defaultdict
23
- from datetime import datetime
24
24
from timeit import default_timer
25
25
from typing import Any , AsyncGenerator , Optional
26
26
@@ -61,7 +61,9 @@ class RunStatus(enum.Enum):
61
61
class RunResult (BaseModel ):
62
62
status : RunStatus = RunStatus .DONE
63
63
result : Optional [DataModel ] = None
64
- timestamp : datetime = Field (default_factory = datetime .utcnow )
64
+ timestamp : datetime .datetime = Field (
65
+ default_factory = lambda : datetime .datetime .now (datetime .timezone .utc )
66
+ )
65
67
66
68
67
69
class TaskPipelineNode (PipelineNode ):
Original file line number Diff line number Diff line change 16
16
17
17
import asyncio
18
18
import tempfile
19
+ from typing import Sized
19
20
from unittest import mock
20
21
from unittest .mock import AsyncMock , call , patch
21
22
22
23
import pytest
23
24
from neo4j_graphrag .experimental .pipeline import Component , Pipeline
24
25
from neo4j_graphrag .experimental .pipeline .exceptions import PipelineDefinitionError
26
+ from neo4j_graphrag .experimental .pipeline .pipeline import RunResult
25
27
26
28
from .components import (
27
29
ComponentAdd ,
@@ -404,3 +406,8 @@ def test_pipeline_draw_missing_pygraphviz_dep() -> None:
404
406
t = tempfile .NamedTemporaryFile ()
405
407
with pytest .raises (ImportError ):
406
408
pipe .draw (t .name )
409
+
410
+
411
+ def test_run_result_no_warning (recwarn : Sized ) -> None :
412
+ RunResult ()
413
+ assert len (recwarn ) == 0
You can’t perform that action at this time.
0 commit comments