cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Fixing warnings in pipeline executions

tstack
Former Employee

With the Summer 2017 release you may see pipeline executions in the Dashboard listing with the following warning symbol in the status column:

image

This warning symbol indicates that a potential issue has been found during the execution and it may need some attention. It does not mean that anything is seriously wrong. The execution should finish as it once did. The warnings are there to help you and us to update your pipeline to make it perform better. To find out what issues were discovered, you can open the Pipeline Execution Statistics dialog and scroll through the list of Snaps to see which ones have a warning attached. For example, if your execution was using the deprecated Join Snap, you would see the following message:

image

Other warnings are related to expression language usage, so you will need to examine the Snapโ€™s configuration to find the expression property that the warning is complaining about. Note that if a child execution has a warning, the parent execution will also have the warning symbol. So, you may need to expand the parent execution in the dashboard to see which child execution has the warning.

The current set of warnings are mostly concerned with deprecated functionality and expression language behavior that deviates from the JavaScript standard.

  • Deprecated Snaps - Snaps that are no longer maintained or have been replaced will be marked with this warning. Most likely you are seeing this message for a Join Snap. You can update the Snap by opening the pipeline in Designer, dragging a new Join Snap onto the canvas, copying the properties from the older Snap instance to the newer one, and then replacing the old instance.

  • toLocaleDateTimeString()/toLocaleDateString()/toLocaleTimeString() was passed a string argument - These functions initially took a JSON-encoded string as an argument instead of an object. Since parsing the JSON string is slow, we wanted to warn about the potential performance hit and to bring people closer to the JavaScript standard. Fixing the warning should just be a matter of removing the outer quotes since the JSON object will treated as an object literal. For example:

    $date.toLocaleDateString('{"format":"MM-dd-yyyy"}') // Generates warning
    $date.toLocaleDateString({"format":"MM-dd-yyyy"}) // No warning
    
  • hasOwnProperty() usage - This method deviated from the JavaScript standard in a few ways, which can cause confusion for people familiar with the language. To make you aware of these differences, we have added the following warning messages:

    • โ€œYou must explicitly check for a null valueโ€ - If the property being tested for was in the object, but had a value of null, the method would return false instead of true. To fix this warning, see this topic for some new ways to check for the existence of a property and get a default value.
    • โ€œUse hasOwnProperty() for each component of the pathโ€ - The argument to this method was treated as a JSON-Path instead of a plain property name, which can cause problems if the property name has a dot in it. To fix the warning, you will need to check for each component in the path. For example:
      $.hasOwnProperty('$.child.value') // Generates warning
      
       // No warning, use if '$child' is not guaranteed to exist
      ('child' in $) && ('value' in $child)
       // No warning and '$child' is always expected to be there
      'value' in $child
      
6 REPLIES 6

jaybodra
New Contributor III

the โ€œinโ€ operator return true if there a property with null value. and if you further check for sub-child it errors out.

example 1:-
$:{
child:null
}

example 2:-
$: {
child: {
child1: โ€œsome valueโ€
}

$.hasOwnProperty() helps in filtering this type of use cause while โ€œinโ€ operator return true for example-1, (โ€˜childโ€™ in $) and will generate an error โ€œRequires an Array or Object in-the-Right-hand-sideโ€ for example-1 if you try this expression: (โ€˜childโ€™ in $) && (โ€˜child1โ€™ in $.child) but it will work for example 2.

get() method works for both the case in order to filter out property based on null try this: ($.get(โ€œchildโ€) != null) && ($.child.get(โ€œchild1โ€) != null). Is โ€œinโ€ operator (shorthand for get()) bugged ?


Get method:


Sorry for bad formatting.

Your expression should be

 'child' in $ && 'child1' in $child

The above will return true is child1 exists in child. Its not $.child

Hope that makes sense.

isnโ€™t this expression $.child compliant with java script?

Yes, โ€œ$.childโ€, โ€œ$childโ€, and โ€œ$[โ€˜childโ€™]โ€ all mean the same thing in the expression language, which is to get the value of the property named โ€œchildโ€. The โ€œ$โ€ symbol refers to the input document, so โ€œ$.childโ€ and โ€œ$[โ€˜childโ€™]โ€ mean lookup โ€œchildโ€ in the document. The โ€œ$childโ€ syntax (i.e. no dot) is a shorthand that is accepted.