Severity of the error and impact on the functionality of the service
- Makes session replenishment of the array completely impossible if, when initially placed, the data contained fractional numbers, the fractional part of which was zero.
- This error does not happen nor prevent the initial filling of the array, perhaps that is why it was not caught in the test scenarios.
How to reproduce
- Version 0.25.1
- Azure instance
Create a Welllog with Curves like this:
POST https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs
{...
"Curves": [
{
"CurveID": "Name",
"NumberOfColumns": 1,
"Mnemonic": "N"
},
{
"CurveID": "Credits",
"NumberOfColumns": 1,
"Mnemonic": "C"
}
],
...}
Populate it with fractionals some of those are actually wholes
POST https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/data
{
"columns": [
"Name",
"Credits"
],
"index": [
0
],
"data": [
["Mike", 100000.00]
]
}
Get the ingested array data back and make sure the fractional is rendered as a integer
GET https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/data
{
"columns": [
"Credits",
"Name"
],
"index": [
0
],
"data": [
[
100000,
"Mike"
]
]
}
Start a session and add a record to the array with a fractional
POST https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/sessions
POST https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/sessions/{{welllogSessionId}}/data
{
"columns": [
"Name",
"Credits"
],
"index": [
1
],
"data": [
["Ros", 26.99]
]
}
Try to commit the session and get a datatype conflict error
PATCH https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/sessions/{{welllogSessionId}}
Response:
{
"detail": "{\"detail\":\"Bulk error: heterogeneous data type detected for columns: Credits\"}"
}
Repeat the row adding attempt with the integer value:
POST https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/sessions/{{welllogSessionId}}/data
{
"columns": [
"Name",
"Credits"
],
"index": [
1
],
"data": [
["Ros", 26]
]
}
Now you can commit the session successfully
PATCH https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/sessions/{{welllogSessionId}}
Response: OK 200
{
"rowCount": 1,
"columnCount": 2,
"columns": [],
"indexStart": "1",
"indexEnd": "1",
"indexType": "int64"
}
Get the appended array data back and make sure the numbers are rendered as a integers
GET https://{{WELLBORE_DDMS_HOST}}/ddms/v3/welllogs/{{WellLogID}}/data
{
"columns": [
"Credits",
"Name"
],
"index": [
0,
1
],
"data": [
[
100000,
"Mike"
],
[
26,
"Ros"
]
]
}
Where the error is generated
https://community.opengroup.org/osdu/platform/domain-data-mgmt-services/wellbore/wellbore-domain-services-worker/-/blob/main/src/wdmsworker/bulk/conflict.py?ref_type=heads#L235