Data Source Config
In principle, you are free to enrich this structure with as many columns as you want (for example Desk, Legal Entity etc). You can either do this manually or use from_config
. Check out an example with explanations of each field: datasource_config.toml.
import ultibi as ul
# You can set up a config and we will take care of
# castings, joins etc
ds = ul.FRTBDataSet.from_config_path("./data/frtb/datasource_config.toml")
print(ds.frame(None))
Validate (work in progress)
If you are missing a required column you will get a runtime error during the execuiton of your request. Alternatively, call `.validate()`` on your dataset. It checks if every required column for every availiable calculation is present. Note: If you can guarantee your particular calculation would not require the missing columns you can proceed at your own risk!
import ultibi as ul
ds = ul.FRTBDataSet.from_config_path("./data/frtb/datasource_config.toml")
try:
ds.validate()
except ul.NoDataError as e:
print(
"One of key columns is missing. Be carefull if you wish to proceed "
"without it. Error: ",
e,
)
print("Complete")