Skip to content

Allow '-' in parquet column names #469

@EmileSonneveld

Description

@EmileSonneveld

This graph saves to parquet, but changes Energy-V1-geothermal to Energy_V1_geothermal

process graph
{
"process_graph": {
  "loadstac9": {
    "arguments": {
      "bands": ["geothermal"],
      "url": "https://catalogue.weed.apex.esa.int/collections/Energy-V1"
    },
    "process_id": "load_stac"
  },
  "dropdimension9": {
    "arguments": {"data": {"from_node": "loadstac9"}, "name": "t"},
    "process_id": "drop_dimension"
  },
  "renamelabels14": {
    "arguments": {
      "data": {"from_node": "dropdimension9"},
      "dimension": "bands",
      "source": ["geothermal"],
      "target": ["Energy-V1-geothermal"]
    },
    "process_id": "rename_labels"
  },
  "aggregatespatial1": {
    "arguments": {
      "data": {"from_node": "renamelabels14"},
      "geometries": {
        "features": [
          {
            "geometry": {"coordinates": [10.089101, 59.612353], "type": "Point"},
            "id": "0",
            "properties": {"MGRSid10": "32VNM61450874"},
            "type": "Feature"
          },
          {
            "geometry": {"coordinates": [10.096994, 59.55544], "type": "Point"},
            "id": "1",
            "properties": {"MGRSid10": "32VNM62000241"},
            "type": "Feature"
          }
        ],
        "type": "FeatureCollection"
      },
      "reducer": {
        "process_graph": {
          "first1": {
            "arguments": {"data": {"from_parameter": "data"}},
            "process_id": "first",
            "result": true
          }
        }
      }
    },
    "process_id": "aggregate_spatial"
  },
  "saveresult1": {
    "arguments": {
      "data": {"from_node": "aggregatespatial1"},
      "format": "Parquet",
      "options": {"feature_id_property": "MGRSid10"}
    },
    "process_id": "save_result",
    "result": true
  }
}
}
parquet_path = glob.glob(os.path.join(output_dir, "**/*.parquet"), recursive=True)
table = pq.read_table(parquet_path)
print(table.column_names)  # ['geometry', 'MGRSid10', 'feature_index', 'Energy_V1_geothermal']

Metadata

Metadata

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