Skip to content

Conversation

@masiafrest
Copy link

@masiafrest masiafrest commented Mar 12, 2025

Problem

While working with financial time series data, I encountered an issue where certain symbols (e.g., "SILG.L") caused values to be null when aligning data, so to give back to the open source community will try to fix this.

This occurs because the system incorrectly treats such keys as field paths, leading to lookup failures.

Cause

The issue happens when using event.get("not.fieldpath"). If a key path like string or does not exist as a valid field path, it returns null.

Example:

const DEEP_EVENT_DATA = Immutable.fromJS({
    NorthRoute: { in: 123, out: 456 },
    SouthRoute: { in: 654, out: 223 },
    "not.fieldpath": { in: 789, out: 223 }
});
const timestamp = time(new Date("2015-04-22T03:30:00Z"));
const event1 = event(timestamp, DEEP_EVENT_DATA);
const eventValue = event1.get("not.fieldpath"); // null

Solution

Added a check to verify if the key exists before treating it as a field path.
If the key exists directly in the object, it is returned correctly instead of being misinterpreted.

Verification

Implemented a test case to reproduce the issue.
The test ensures that keys like "SILG.L" are handled properly.
All tests pass successfully after applying the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant