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 1515from __future__ import annotations
1616
1717import asyncio
18+ import datetime
1819import enum
1920import logging
2021import uuid
2122import warnings
2223from collections import defaultdict
23- from datetime import datetime
2424from timeit import default_timer
2525from typing import Any , AsyncGenerator , Optional
2626
@@ -61,7 +61,9 @@ class RunStatus(enum.Enum):
6161class RunResult (BaseModel ):
6262 status : RunStatus = RunStatus .DONE
6363 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+ )
6567
6668
6769class TaskPipelineNode (PipelineNode ):
Original file line number Diff line number Diff line change 1616
1717import asyncio
1818import tempfile
19+ from typing import Sized
1920from unittest import mock
2021from unittest .mock import AsyncMock , call , patch
2122
2223import pytest
2324from neo4j_graphrag .experimental .pipeline import Component , Pipeline
2425from neo4j_graphrag .experimental .pipeline .exceptions import PipelineDefinitionError
26+ from neo4j_graphrag .experimental .pipeline .pipeline import RunResult
2527
2628from .components import (
2729 ComponentAdd ,
@@ -404,3 +406,8 @@ def test_pipeline_draw_missing_pygraphviz_dep() -> None:
404406 t = tempfile .NamedTemporaryFile ()
405407 with pytest .raises (ImportError ):
406408 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