bugGNU Octave - Bugs: bug #56544, [octave forge] (dataframe) error:...

 
 

bug #56544: [octave forge] (dataframe) error: The output format qualifier "as" must be followed by a type

Submitted by:  G. Richard Bellamy <rbellamy>
Submitted on:  Mon 24 Jun 2019 09:55:12 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  5.1.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 25 Jul 2019 10:16:57 AM UTC, comment #3: 

The code:
https://sourceforge.net/p/octave/dataframe/ci/dataframe-1.2.0/tree/inst/@dataframe/subsref.m#l37

  if (strcmp (S(1).type, '.')) %# struct access
    indi = regexp (S(1).subs, 'as');
    if (~isempty (indi))
      if (length (S) < 2 || ~strcmp (S(2).type, '.'))
        error ('The output format qualifier "as" must be followed by a type');
      end
      asked_output_type = 'array';
      asked_output_format = S(2).subs; S = S(3:end);
    else

If I change it to:

 if (strcmp (S(1).type, '.')) %# struct access
    if (strcmp (S(1).subs, 'as'))
      if (length (S) < 2 || ~strcmp (S(2).type, '.'))
        error ('The output format qualifier "as" must be followed by a type');
      end
      asked_output_type = 'array';
      asked_output_format = S(2).subs; S = S(3:end);
    else

It stops doing it

John Donoghue <lostbard>
Project Member
Wed 24 Jul 2019 07:08:40 PM UTC, comment #2: 

comment #1:

> It looks like it is thinking the 'as' in 'lastday' is the .as. subsref function.


Yikes. Does this mean that I could conceivably create a field name that caused some kind of function injection?

G. Richard Bellamy <rbellamy>
Tue 23 Jul 2019 10:20:24 AM UTC, comment #1: 

It looks like it is thinking the 'as' in 'lastday' is the .as. subsref function.

John Donoghue <lostbard>
Project Member
Mon 24 Jun 2019 09:55:12 PM UTC, original submission:  

Steps to reproduce:

>> d = dataframe('data-1561346494910.csv)
d = dataframe with 28 rows and 2 columns
Src: data-1561346494910.csv
_1          lastday  count
Nr             char double
1 2016-08-31 00:00     85
2 2016-09-30 00:00     85
3 2016-10-31 00:00     84
4 2016-11-30 00:00     89
5 2016-12-31 00:00     85
6 2017-01-31 00:00     88
7 2017-02-28 00:00     91
8 2017-03-31 00:00     91
9 2017-04-30 00:00     93
10 2017-05-31 00:00     95
11 2017-06-30 00:00     93
12 2017-07-31 00:00     96
13 2017-08-31 00:00     98
14 2017-09-30 00:00     98
15 2017-10-31 00:00    107
16 2017-11-30 00:00    107
17 2017-12-31 00:00    106
18 2018-01-31 00:00    112
19 2018-02-28 00:00    110
20 2018-03-31 00:00    113
21 2018-10-31 00:00    114
22 2018-11-30 00:00    113
23 2018-12-31 00:00    104
24 2019-01-31 00:00    102
25 2019-02-28 00:00    104
26 2019-03-31 00:00    107
27 2019-04-30 00:00    107
28 2019-05-31 00:00    107

>> d.lastday
error: The output format qualifier "as" must be followed by a type
error: called from
    subsref at line 40 column 9

Expected behavior:

The column "lastday" output.

Note:

>> d.array(:,1)
ans =

2016-08-31 00:00
2016-09-30 00:00
2016-10-31 00:00
2016-11-30 00:00
2016-12-31 00:00
2017-01-31 00:00
2017-02-28 00:00
2017-03-31 00:00
2017-04-30 00:00
2017-05-31 00:00
2017-06-30 00:00
2017-07-31 00:00
2017-08-31 00:00
2017-09-30 00:00
2017-10-31 00:00
2017-11-30 00:00
2017-12-31 00:00
2018-01-31 00:00
2018-02-28 00:00
2018-03-31 00:00
2018-10-31 00:00
2018-11-30 00:00
2018-12-31 00:00
2019-01-31 00:00
2019-02-28 00:00
2019-03-31 00:00
2019-04-30 00:00
2019-05-31 00:00

G. Richard Bellamy <rbellamy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47133:  data-1561346494910.csv added by rbellamy (617B - application/vnd.ms-excel)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by rbellamy (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-07-23 lostbard StatusNone => Confirmed
        Operating SystemMicrosoft Windows => Any
    2019-06-26 mtmiller Summaryerror: The output format qualifier "as" must be followed by a type => [octave forge] (dataframe) error: The output format qualifier "as" must be followed by a type
    2019-06-24 rbellamy Attached File- => Added data-1561346494910.csv, #47133

    Back to the top


    Powered by Savane 3.5