stoneelsie / google-refine

Automatically exported from code.google.com/p/google-refine
Other
0 stars 0 forks source link

onError - "keep-original" / "store-blank" working oddly for value.toDate() #441

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Edit Cells > Common Transforms > To date on a column of words leaves them blank.

Edit Cells > Common Transforms > To number on a column of words leaves them as 
their originals.

Specifying "keep-original" for the onError value doesn't seem to produce the 
correct result either - it acts as if it's "store-blank".

                Refine.postCoreProcess(
                  "text-transform",
                  {
                    columnName: $(this).html(), 
                    expression: "value.toDate()",
                    repeat: false,
                                    onError:"keep-original",
                    repeatCount: ""
                  },
                  null,
                  { cellsChanged: true }
                );

Using function(){alert("Not a valid date")} as the onError value works, but 
still turns the cell blank.

Original issue reported on code.google.com by danpaulsmith on 26 Aug 2011 at 11:53

GoogleCodeExporter commented 8 years ago
Please include the version of Refine that you are using (2.1, 2.0, trunk) with 
all bug reports.

I spotted some anomalies in this area recently, so I'll have a look.

Original comment by tfmorris on 13 Sep 2011 at 8:54

GoogleCodeExporter commented 8 years ago
I've committed some improvements in r2237, but will try to take a closer look 
later.

Original comment by tfmorris on 13 Sep 2011 at 9:02

GoogleCodeExporter commented 8 years ago
I've confirmed that this is definitely broken in 2.1 and the patch I made fixes 
the problem described.  Since it works with the default setup, I'm not going to 
worry about testing with alternate onError parameters.

Original comment by tfmorris on 22 Sep 2011 at 11:16