This was a bug in the implementation of the
MissingBehavior option of
Dataset. The bug was present in version 10.4.1 and fixed by the time of version 11.0.1.
Analysis (current as of version 11.0.1)
By default, a dataset query defaults to the option
MissingBehavior -> Automatic. This applies special behaviour that is tolerant of the presence of
Missing in data. In the case at hand, the expression
1 + Missing is interpreted as simply
Plus (i.e. the
Missing is interpreted as an empty sequence).
The problem arises in the implementation of this special missing behaviour. It is done by temporarily installing extra definitions upon the symbol
Missing. These definitions are installed by the internal function
In version 10.4 this function would only install the extra definitions if a certain global symbol lacked an undocumented property. But there was a bug because, as the definitions were applied, the undocumented property was set upon the symbol as a side-effect. The presence of the property in the second and subsequent evaluations would prevent the extra
Missing definitions from being applied and the query would behave as if the option
MissingBehavior -> None had been specified.
In version 11, the special definitions are now installed unconditionally so the defect no longer appears. Versions prior to 10.4 also installed the definitions unconditionally.