This message was deleted.
# hamilton-help
s
This message was deleted.
e
ha! Code that generated it (ideally just the
ice_position_mapping
fn?). That’s a weird-looking bug, but it actually does seem supported. 90% chance that the split by commans doesn’t work here — its a little cheap how it does it.
s
Copy code
@schema.output(
    ("LOGICAL_COMMODITY", "str"),
    ("PHYSICAL_COMMODITY", "str"),
    ("GENERIC_CONTRACT_TYPE", Literal["F","O","M","D"])
)
def ice_position_mapping() -> pd.DataFrame:
    """Used for mapping `contract_type` to exchange product code."""
    _ice_pos = ice_position_file_guide()[
        ["LOGICAL_COMMODITY", "PHYSICAL_COMMODITY", "GENERIC_CONTRACT_TYPE"]
        ]
    return _ice_pos
e
Ok, cool, yeah that’s a bug. Can fix soon. In the meanwhile, try out something like:
Copy code
@schema.output(
    ("LOGICAL_COMMODITY", "str"),
    ("PHYSICAL_COMMODITY", "str"),
    ("GENERIC_CONTRACT_TYPE", 'Literal["F":"O":"M":"D"]')
)
s
ok sounds good, tyvm sir
I wonder if there’s a way this could eventually pull up the
pandas.DataFrame.dtypes
from the
return
into
schema.output
? Not sure if that would be desirable functionality for anyone else. For annotation probably, but may get tricky if
schema.output
is used to validate
e
Yeah so the idea is to have this at compile-time (E.G. before we run it). On the closed-source side we have tooling to track the schemas, and are thinking of OSing some of it. Alternatively you could potentially generate the decorator code by running the DAG and listening to it, to bootstrap…
s
Yeah I see, so even it if were to have that capability
driver.visualize_execution
wouldn’t be able to see it
e
Yep, it’s a post-execution piece