Ticket #396 (new defect)

Opened 2 years ago

grouping fails if column names aliased to method names

Reported by: ruport Assigned to:
Milestone: Keywords:
Cc: curtis.abbott@gmail.com

Description

The failure occurs if the column name of a Table is the same as a defined method of Group. I traced the failure to Group#grouped_data, in the &block arg to sub_table where a send is done to the column name. This is line 114 of grouping.rb in the release 1.2.3 I downloaded. I'm not sure the right way to fix.

Example 1:

    tbl = Table(['a', 'b', 'method'])
    tbl << [1,2,3] << [4,5,6]
    grp = Grouping(tbl, :by => 'method')

result

ArgumentError?: wrong number of arguments (0 for 1)

Example 2:

    tbl = Table(['a', 'b', 'methods'])
    tbl << [1,2,3] << [4,5,6]
    grp = Grouping(tbl, :by => 'methods')

result

grp is created but contains no subtables.