Subject: | get_inflated_column should not throw an exception on column with no explicit inflation defined |
I have generic code that wants inflated values for individual columns that may or may not have inflation defined.
It seems reasonable to me to view all columns has having an implicit 'null' (transparent) inflation by default.
I see no value in get_inflated_column throwing an exception.
A workaround would be to call get_inflated_columns but that's expensive when I only want one column, for example.
I suggest a change from this:
sub get_inflated_column {
my ($self, $col) = @_;
$self->throw_exception("$col is not an inflated column")
unless exists $self->column_info($col)->{_inflate_info};
return $self->{_inflated_column}{$col}
if exists $self->{_inflated_column}{$col};
my $val = $self->get_column($col);
return $val if ref $val eq 'SCALAR'; #that would be a not-yet-reloaded sclarref update
return $self->{_inflated_column}{$col} = $self->_inflated_column($col, $val);
}
To something like this:
sub get_inflated_column {
my ($self, $col) = @_;
return $self->{_inflated_column}{$col}
if exists $self->{_inflated_column}{$col};
my $val = $self->get_column($col);
return $val if ref $val eq 'SCALAR'; #that would be a not-yet-reloaded sclarref update
return $val unless exists $self->column_info($col)->{_inflate_info};
return $self->{_inflated_column}{$col} = $self->_inflated_column($col, $val);
}