Skip to content

Commit 16e2e37

Browse files
authored
Merge pull request #83 from corva-ai/feature/DRO-325_delete_optional_fields
DRO-325 | Remove redundant fields and changed data payload to accept new fields
2 parents 524be4d + 5018f7d commit 16e2e37

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- Fields `partition` and `rerun_partition` are not expected in partial merge event payload.
9+
- Data structure under `data` key of partial merge event payload can accept additional fields.
810

911

1012
## [1.11.0] - 2023-12-07

src/corva/models/merge/merge.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class PartialRerunMergeEvent(CorvaBaseEvent):
88
Attributes:
99
event_type: EventType.PARTIAL_WELL_RERUN_MERGE
1010
partial_well_rerun_id: partial well rerun id
11-
partition: partition
12-
rerun_partition: rerun partition
1311
rerun_mode: rerun mode
1412
start: start
1513
end: end
@@ -29,8 +27,6 @@ class PartialRerunMergeEvent(CorvaBaseEvent):
2927

3028
event_type: EventType
3129
partial_well_rerun_id: int
32-
partition: int
33-
rerun_partition: int
3430
rerun_mode: RerunMode
3531
start: int
3632
end: int
@@ -46,3 +42,6 @@ class PartialRerunMergeEvent(CorvaBaseEvent):
4642
source_type: SourceType
4743
log_type: str
4844
run_until: int
45+
46+
class Config:
47+
extra = "allow"

src/corva/models/merge/raw.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
class RawPartialMergeEventData(pydantic.BaseModel):
1212
partial_well_rerun_id: int
13-
partition: int
14-
rerun_partition: int
1513
rerun_mode: RerunMode
1614
start: int
1715
end: int
@@ -30,6 +28,9 @@ class RawPartialMergeEventData(pydantic.BaseModel):
3028
log_type: str
3129
run_until: int
3230

31+
class Config:
32+
extra = "allow"
33+
3334

3435
class RawPartialRerunMergeEvent(CorvaBaseEvent, RawBaseEvent):
3536
event_type: EventType

tests/unit/test_docs/test_app_types.py

-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ def test_tutorial007(app_runner):
7373
partial_rerun_merge_event = PartialRerunMergeEvent(
7474
event_type="partial-well-rerun-merge",
7575
partial_well_rerun_id=123,
76-
partition=95,
77-
rerun_partition=2,
7876
rerun_mode="realtime",
7977
start=1543847760,
8078
end=1543847760,

tests/unit/test_partial_rerun_merge_app.py

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
"event_type": "partial-well-rerun-merge",
1414
"data": {
1515
"partial_well_rerun_id": 123,
16-
"partition": 95,
17-
"rerun_partition": 2,
1816
"rerun_mode": "realtime",
1917
"start": 1543847760,
2018
"end": 1543847760,

0 commit comments

Comments
 (0)