Closed xbanke closed 3 years ago
I was able to isolate the issue (the heuristic for guessing a "tag" for this Union was sometimes extracting fields with mutable values) and got it working, but FYI, a Union of Series and DataFrame won't be able to differentiate the two from the point of view of incoming data which is not one of these types. It will always be coerced to the first type in the Union:
>>> Foo.transmute({"a": {"data": {"d": {}}}})
Foo(a=A(data={'d': Series([], dtype: float64)}))
Description
The result of the following script is unpredictable:
Sometime, it passed. But not passed every time. It raises
unhashable type: 'set'
orunhashable type: 'dict'
orunhashable type: 'list'
, sometime. Maybe, it's caused bytyping.Union[pd.Series, pd.DataFrame]
.