You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "detvdl (via GitHub)" <gi...@apache.org> on 2024/09/12 14:40:39 UTC

[PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

detvdl opened a new pull request, #42199:
URL: https://github.com/apache/airflow/pull/42199

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   Fixed issues described in https://github.com/apache/airflow/issues/42096, which were introduced in https://github.com/apache/airflow/commit/563bc494ab5c610c46a60b2fe6beed742e3d588e
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #42199:
URL: https://github.com/apache/airflow/pull/42199#issuecomment-2346521254

   Well funny enough I just left a comment [here](https://github.com/apache/airflow/pull/42152#discussion_r1756905594) on a very related null/undefined check.
   
   This is a mistake that is common in our codebase when we do `!` and `!!` on falsy values unfortunately. We need to pay extra attention to that.
   
   Also `NaN` is yet another case to handle (nullish coallescing will not handle that, we might need a common utility function)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

Posted by "detvdl (via GitHub)" <gi...@apache.org>.
detvdl commented on PR #42199:
URL: https://github.com/apache/airflow/pull/42199#issuecomment-2346624161

   > Also do you mind explaining why we explicitely try to `isNaN` the value ? Coercion of isNaN is somewhat surprising, and I' m not sure what we are trying to actually check under the hood. Xcom values are bool, number, obj / null / undefined.
   
   `isNaN` returns True for both undefined or NaN so it was mostly a shortcut to check for both
   
   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 🙂 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #42199:
URL: https://github.com/apache/airflow/pull/42199#issuecomment-2348217633

   I like your proposal:
   ```
   if (xcom.value ?? Number.isNaN(xcom.value))
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #42199:
URL: https://github.com/apache/airflow/pull/42199


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #42199:
URL: https://github.com/apache/airflow/pull/42199#issuecomment-2348455633

   Great, thanks for the investigation @detvdl 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: render non-null falsy XCom entries correctly in UI [airflow]

Posted by "detvdl (via GitHub)" <gi...@apache.org>.
detvdl commented on PR #42199:
URL: https://github.com/apache/airflow/pull/42199#issuecomment-2348243693

   > ```
   > if (xcom.value ?? Number.isNaN(xcom.value))
   > ```
   > 
   > In that case if we have a value we will enter the loop.
   
   Ah you're right, I hadn't stopped to think about that, good call!
   
   I don't know about the NaN either, let me spend a little more time checking if it can happen and I will come back to this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org