-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: render non-null falsy XCom entries correctly in UI #42199
Fix: render non-null falsy XCom entries correctly in UI #42199
Conversation
Well funny enough I just left a comment here on a very related null/undefined check. This is a mistake that is common in our codebase when we do Also Also do you mind explaining why we explicitely try to |
Perhaps more idiomatic would be to use the nullish coalescing here to more explicitly catch the first 2 cases (null and undefined) and explicitly call if (xcom.value ?? Number.isNaN(xcom.value)) From a quick peek at the code I figured both cases could be present exceptionally but I may be wrong, have only looked at the UI rendering for a few minutes. I pragmatically just tackled this specific issue as soon as I saw it, and got a PR out not to forget 🙂 |
In that case if we have a value we will enter the loop. Maybe a simple:
We can always add the |
dacc91c
to
6784a66
Compare
Ah you're right, I hadn't stopped to think about that, good call!
After a quick peek, I can see that the XCom model value is serialized through There are ways to support NaN in those schemas for serialization (https://marshmallow.readthedocs.io/en/stable/upgrading.html#float-field-takes-a-new-allow-nan-parameter) but it's not the default, and nowhere in this codebase is it explicitly set (nor do I think Airflow uses a version of that dep which supports it) So you're right @pierrejeambrun , just a plain |
fix: only treat null, undefined or NaN as NULL in XComEntry render fix: use coalescing nullish check + isNaN fix: only treat null/undefined as falsy when rendering XComEntry
6784a66
to
f610c19
Compare
Great, thanks for the investigation @detvdl |
…che#42199) fix: only treat null, undefined or NaN as NULL in XComEntry render fix: use coalescing nullish check + isNaN fix: only treat null/undefined as falsy when rendering XComEntry (cherry picked from commit ade9de1)
…che#42199) fix: only treat null, undefined or NaN as NULL in XComEntry render fix: use coalescing nullish check + isNaN fix: only treat null/undefined as falsy when rendering XComEntry
Fixed issues described in #42096, which were introduced in 563bc49