You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spreadsheet BlankMissing.xlsx has a blank in the key column SET, in the row corresponding to cost value 5. This causes the set member Missing to be created:
ampl: reset;
ampl: set S;
ampl: param cost {S};
ampl: table Cost IN "amplxl" "BlankMissing.xlsx": S <- [SET], cost;
ampl: read table Cost;
ampl: display cost;
cost [*] :=
A 1
B 2
C 3
D 4
Missing 5
;
Eventually the user sees an error of some sort in processing the model, but it is hard to trace that error back to the cause. The amplxl interface could instead report an error immediately when there is a blank in a key column for the table being read.
In some situations where there is more than one blank in the key column, an error message does appear immeidately, but it is not specific:
Error reading table Cost with table handler amplxl:
Could not parse data
"Missing" could probably be considered a kind of keyword as it is used for the cases where the data is specified with a dot, like in the tab table handler.
It is possible to reproduce the current behavior with the tab table handler. However, I don't think it 's possible to write a .tab file with a Missing value in a key column in AMPL (It would have to be done manually).
The Missing read from a key column is probably not expected by the user, the "Could not parse data" message is overriding the error from duplicate keys #12 when multiple Missing values are present.
After the change amplxl will trigger an error immediately if it finds missing values in key columns of regular or 2D tables.
Activity
Report error when missing values are found in key columns (####14)
nfbvs commentedon Jan 5, 2021
"Missing" could probably be considered a kind of keyword as it is used for the cases where the data is specified with a dot, like in the tab table handler.
It is possible to reproduce the current behavior with the tab table handler. However, I don't think it 's possible to write a .tab file with a Missing value in a key column in AMPL (It would have to be done manually).
The Missing read from a key column is probably not expected by the user, the "Could not parse data" message is overriding the error from duplicate keys #12 when multiple Missing values are present.
After the change amplxl will trigger an error immediately if it finds missing values in key columns of regular or 2D tables.