Skip to content

Import Scheme rule "If object is not found" = "Treat as Error" is ignored (PriceHistory import) #184

@sergeiosipov

Description

@sergeiosipov

Bug: Import Scheme rule "If object is not found" = Treat as Error is ignored (PriceHistory import)

Summary

In Simple Entity Import Scheme Manager (v2), setting Import Rules → If object is not found = Treat as Error does not prevent booking.
When an object referenced by an input field is missing (e.g., Pricing Policy), the import still succeeds and the item is booked using a default value.

You can see the setting in com.finmars.standard-import-from-file:instruments.pricehistory:prices_prc:
Image


Environment

  • PMS Core: latest
  • Import scheme user code: com.finmars.standard-import-from-file:instruments.pricehistory:prices_prc
  • UI: Simple Entity Import Scheme Manager (v2)

Steps to Reproduce

  1. Install latest PMS Core
  2. Open Import → Import Data from File
  3. Select entity
    Price History
  4. Select Import Scheme
    STD - PRC
  5. Import a row with a non-existing Pricing Policy:
[
    {
        "Accrued Price": 0,
        "Date": "2011-08-05T00:00:00",
        "Factor": 1,
        "Instrument ID": "-",
        "Modified Duration": 0,
        "Pricing Policy": "com.finmars.standard-pricing:doesnt_exist",
        "Principal Price": 1,
        "YTM": 0,
        "is_temporary_price": false,
        "long_delta": 0,
        "short_delta": 0
    }
]
Image

Actual Result

  • "com.finmars.standard-pricing:doesnt_exist" is not found
  • Key pricing_policy is removed from final_inputs
  • Error message is formed:
    None Relation model error: KeyError('pricing_policy')
  • Import finishes with status: "success"
  • Price is booked (default pricing policy is applied)

Example response:

{
  "error_message": "None Relation model error: KeyError('pricing_policy')",
  "final_inputs": {
    "accrued_price": 0,
    "date": "2011-08-05",
    "factor": 1,
    "instrument": "-",
    "principal_price": 1
  },
  "message": "Item Imported pricehistory",
  "status": "success"
}

Expected Result

  • "com.finmars.standard-pricing:doesnt_exist" is not found
  • Key pricing_policy is removed from final_inputs
  • Error message is formed
  • Import result must be status: "error"
  • Price must NOT be booked

Notes

It appears that when a referenced relation is not found:

  • the field is removed from final_inputs
  • an error message is generated
  • but the pipeline continues and applies defaults

The "Treat as Error" rule does not escalate the failure to an error status and does not stop booking.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions