Skip to content

Missing set member is given unexpected name #14

Open

Description

@4er4er4er

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

Activity

  1. nfbvs commented on Jan 5, 2021

    @nfbvs
    Contributor

    "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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions