Hey. How can I fix this? Not really seeing how the...
# hamilton-help
s
Hey. How can I fix this? Not really seeing how these are different types.
Copy code
Error: Type requirement mismatch. 
Expected irm:<class 'irm2.api.ice_risk_model_api.IceRiskModel'> 
got <irm2.api.ice_risk_model_api.IceRiskModel object at 0x00000191729D64B0>:<class 'irm2.api.ice_risk_model_api.IceRiskModel'> instead.
e
Hmm, on the surface those look similar but hard to tell
Or debug as to why it doesn't work using
issubclass
s
It was working normally in Jupyter then after running the cell a few more times maybe it thinks something changed? I’ll try your solution, thanks!
e
Try resetting jupyter? Could have to do with reloading files/object pointers. My solution is likely overkill here.
s
Restarting Jupyter fixed the issue, but I suspect that hook would have fixed it otherwise
@Elijah Ben Izzy I upgraded from
v1.51.1
to
v1.87.0
to be able to use the NoEdgeAndInputTypeChecking and am now getting this type error. Is this correct?
Copy code
@config.when(execution="parallel")
def account_to_query(accounts: List[str]) -> Parallelizable[str]:
    for acct in accounts:
        yield acct

@config.when(execution="parallel")
def search_params(cob_date: datetime, account_to_query: str) -> dict:
    ...
Error
Copy code
ValueError: Error: search_params is expecting account_to_query:<class 'str'>, but found account_to_query:hamilton.htypes.Parallelizable[str]. 
Hamilton does not consider these types to be equivalent.