myGrid

Save as Excel bails out on deep lists

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Taverna Data
  • Labels:
    None

Description

When producing a deeply nested list, as in "[Taverna-hackers] Save to excel" thread by 2006-08-22, Save as Excel don't work properly.

Although an empty spreadsheet is produced, no warnings or anything is shown that the list is too deep to be excelcified.

  1. excel-deep.xml
    2006-09-06 10:20
    0.5 kB
    Stian Soiland-Reyes
  2. excel-deep-in.xml
    2006-09-06 10:20
    5 kB
    Stian Soiland-Reyes

Issue Links

Activity

Hide
Stian Soiland-Reyes added a comment - 2006-08-23 10:20

Possibly duplicate of TAV-116.. we should check if it is deep lists or empty lists or both that causes problems.

Show
Stian Soiland-Reyes added a comment - 2006-08-23 10:20 Possibly duplicate of TAV-116.. we should check if it is deep lists or empty lists or both that causes problems.
Hide
Stian Soiland-Reyes added a comment - 2006-09-06 10:19

I am able to reproduce, see attached workflow and example inputs.

With a deeply nested list, only the last list of list of values will be exported, in the example, the inputs are

{ #l1
{ #l2
{1 2 3} #l3
{4 5 6} #l4
}
{ #l5
{7 8 9} #l6
{10 11 12} #l7
}
}

But the saved Excel only contains two rows of data:

7 8 9
10 11 12

This suggests that #l5 is the only list of list of values that was saved.

In TAV-116, what happened with the empty excel is probably that the last l(l(text/plain)) contained just empty lists.

Show
Stian Soiland-Reyes added a comment - 2006-09-06 10:19 I am able to reproduce, see attached workflow and example inputs. With a deeply nested list, only the last list of list of values will be exported, in the example, the inputs are { #l1 { #l2 {1 2 3} #l3 {4 5 6} #l4 } { #l5 {7 8 9} #l6 {10 11 12} #l7 } } But the saved Excel only contains two rows of data: 7 8 9 10 11 12 This suggests that #l5 is the only list of list of values that was saved. In TAV-116, what happened with the empty excel is probably that the last l(l(text/plain)) contained just empty lists.
Hide
Stian Soiland-Reyes added a comment - 2006-09-06 10:35

Actually.. the code of SaveAsExcel.java uses:

private boolean isTextual(Object o) {
if (o instanceof String) { return true; }
if (o instanceof Collection) {
Collection c = (Collection) o;
if (c.isEmpty()) { return false; }
return isTextual(c.iterator().next());
}
return false;
}

So if anywhere down the first element path is an empty list, the whole dataset will be skipped. Reopening TAV-116.

Show
Stian Soiland-Reyes added a comment - 2006-09-06 10:35 Actually.. the code of SaveAsExcel.java uses: private boolean isTextual(Object o) { if (o instanceof String) { return true; } if (o instanceof Collection) { Collection c = (Collection) o; if (c.isEmpty()) { return false; } return isTextual(c.iterator().next()); } return false; } So if anywhere down the first element path is an empty list, the whole dataset will be skipped. Reopening TAV-116.
Hide
Stian Soiland-Reyes added a comment - 2006-09-15 14:08

Fixed in CVS

Show
Stian Soiland-Reyes added a comment - 2006-09-15 14:08 Fixed in CVS
Hide
Stian Soiland-Reyes added a comment - 2006-09-15 14:08

Confirmed with original workflow from submitter

Show
Stian Soiland-Reyes added a comment - 2006-09-15 14:08 Confirmed with original workflow from submitter

People

Vote (0)
Watch (0)

Dates

  • Created:
    2006-08-22 10:02
    Updated:
    2006-09-15 14:08
    Resolved:
    2006-09-15 14:08