fix incorrect remapping of ellipsis

pull/2133/head
ly015 2022-05-24 00:11:06 +08:00 committed by zhouzaida
parent a7106c6bfe
commit eb3bd34c31
1 changed files with 7 additions and 1 deletions

View File

@ -291,7 +291,13 @@ class KeyMapper(BaseTransform):
results.update(_map(d_i, m_i))
return results
if m is IgnoreKey:
# ``m is ...`` means the key is marked ignored, in which case the
# inner resuls will not affect the outer results in remapping.
# Another case that will have ``data is IgnoreKey`` is that the
# key is missing in the inputs. In this case, if the inner key is
# created by the wrapped transforms, it will be remapped to the
# corresponding outer key during remapping.
if m is ... or data is IgnoreKey:
return {}
return {m: data}