Files
Alexandre Catarino 521b3335fa Throw clear error when add_data first argument is not a custom data class (#9473)
* Throw clear error when AddData is called with a non-class first argument from Python

Calls like self.add_data("VIX", Resolution.DAILY) routed through CreateType, which
silently built a dynamic assembly named after the string and returned a fake type
whose activator factory tried to invoke the str like a function. The downstream
'str' object is not callable PythonException surfaced confusingly (and could
manifest as an apparent hang depending on where it was caught), making the actual
mistake hard to diagnose.

Validate the PyObject up front via TryCreateType in the AddData(PyObject, ...)
entry points and throw an ArgumentException pointing the user at AddEquity /
AddForex / etc. when the argument is not a custom data class.

* Improve the error message

Use only two alternative methods as examples, as we don't need an exhaustive list.
2026-05-12 11:44:40 -03:00
..
2026-04-07 17:41:12 -04:00
2021-04-02 11:20:01 -07:00
2026-05-06 15:57:09 -03:00
2026-04-07 17:41:12 -04:00
2024-11-01 19:13:07 -03:00
2022-11-09 17:38:34 -03:00
2026-04-07 17:41:12 -04:00
2024-07-09 11:08:42 -03:00
2023-08-08 17:52:46 -03:00
2026-01-14 11:55:29 -03:00
2026-04-07 17:41:12 -04:00
2025-11-24 17:09:39 -04:00