Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Event Creation: Add version and make sure we don't call autoreload attributes #834

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/taipy/core/data/data_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def make_event_for_datanode(
attribute_value: Optional[Any] = None,
**kwargs,
) -> Event:
metadata = {"config_id": data_node.config_id, **kwargs}
metadata = {"config_id": data_node.config_id, "version": data_node._version, **kwargs}
return Event(
entity_type=EventEntityType.DATA_NODE,
entity_id=data_node.id,
Expand Down
9 changes: 7 additions & 2 deletions src/taipy/core/job/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,17 @@ def _make_event_for_job(
attribute_value: Optional[Any] = None,
**kwargs,
) -> Event:
metadata = {"creation_date": job.creation_date, "task_config_id": job._task.config_id}
metadata = {
"creation_date": job._creation_date,
"task_config_id": job._task.config_id,
"version": job._version,
**kwargs,
}
return Event(
entity_type=EventEntityType.JOB,
entity_id=job.id,
operation=operation,
attribute_name=attribute_name,
attribute_value=attribute_value,
metadata={**metadata, **kwargs},
metadata=metadata,
)
2 changes: 1 addition & 1 deletion src/taipy/core/scenario/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def _make_event_for_scenario(
attribute_value: Optional[Any] = None,
**kwargs,
) -> Event:
metadata = {"config_id": scenario.config_id, "version": scenario.version, **kwargs}
metadata = {"config_id": scenario.config_id, "version": scenario._version, **kwargs}
return Event(
entity_type=EventEntityType.SCENARIO,
entity_id=scenario.id,
Expand Down
4 changes: 2 additions & 2 deletions src/taipy/core/submission/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ def _make_event_for_submission(
attribute_value: Optional[Any] = None,
**kwargs,
) -> Event:
metadata = {"creation_date": submission.creation_date, "version": submission._version}
metadata = {"creation_date": submission.creation_date, "version": submission._version, **kwargs}
return Event(
entity_type=EventEntityType.SUBMISSION,
entity_id=submission.id,
operation=operation,
attribute_name=attribute_name,
attribute_value=attribute_value,
metadata={**metadata, **kwargs},
metadata=metadata,
)
Loading