ddavisqa / google-refine

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

GREL variable cells.colName returns null when cell contains null value #252

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Click column header -> Edit Cells -> Transform
2. Enter GREL expression cells.colName, where colName is a column that contains 
both null and non-null values
3. In preview tab, rows with non-null colName value show '[object Cell]'. Rows 
with null colName value show 'null'
4. Enter GREL expression cells.colName.value
4. In preview tab, rows with non-null colName value show cell value. Rows with 
null colName value show 'Error: Cannot retrieve field from null'

What is the expected output? What do you see instead?
I would expect that cells.colName always returns a cell object and that 
cells.colName.value returns null if the value is null

What version of the product are you using? On what operating system?
Refine 2.0-r1836
Chrome 9.0.587.0 dev
Windows XP Pro SP2

Original issue reported on code.google.com by jcreena...@gmail.com on 25 Nov 2010 at 4:10

Attachments:

GoogleCodeExporter commented 8 years ago
I think not having a Cell object for a cell with a null value could be 
considered a useful memory optimization.  

Would it be acceptable to you to have cells.colName.value return null instead 
of an error, rather than wasting the space by allocating Cell objects for all 
the blank cells?

Original comment by tfmorris on 8 Oct 2011 at 9:33

GoogleCodeExporter commented 8 years ago
Yeah that sounds fine. The main point is that cells.colName.value returns null 
instead of an error; I'm not worried about how that is accomplished.

Original comment by jcreena...@gmail.com on 9 Oct 2011 at 12:07