← drop operator page · clause/drop/basic/manual_ex_1

Manual example 1 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

drop At_1: an attribute removed.

Manual:

Removal of Components, Example 1, output verbatim: "The operator drops the specified Components and maintains all the other Components of the Data Set."

Expected:

The three identifiers and Me_1, on the same data points.

script.vtl ⇩

DS_r := DS_1 [ drop At_1 ];

input/DS_1.csv ⇩

Id_1Id_2Id_3Me_1At_1
2010AXX20E
2010AYY4F
2010BXX9F

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "Time_Period", "role": "Identifier", "nullable": false},
        {"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
        {"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Id_2Id_3Me_1
2010AXX20
2010AYY4
2010BXX9

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Time_Period", "role": "Identifier"},
        {"name": "Id_2", "type": "String", "role": "Identifier"},
        {"name": "Id_3", "type": "String", "role": "Identifier"},
        {"name": "Me_1", "type": "Integer", "role": "Measure"}
      ]
    }
  ]
}