Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject job/service/... when parameters are not defined #41

Closed
m-mohr opened this issue May 28, 2020 · 1 comment
Closed

Reject job/service/... when parameters are not defined #41

m-mohr opened this issue May 28, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@m-mohr
Copy link
Member

m-mohr commented May 28, 2020

The driver accepts this process as batch job:

{
  "id": null,
  "process_graph": {
    "load_collection_HTFOJ1599M": {
      "process_id": "load_collection",
      "arguments": {
        "id": {
          "from_parameter": "collection"
        },
        "spatial_extent": {
          "west": 16.1,
          "east": 16.6,
          "north": 48.6,
          "south": 47.2
        },
        "temporal_extent": [
          "2018-04-01",
          "2018-05-01"
        ],
        "bands": [
          "B8",
          "B4",
          "B2"
        ]
      }
    },
    "reduce_dimension_WUGND8993F": {
      "process_id": "reduce_dimension",
      "arguments": {
        "data": {
          "from_node": "load_collection_HTFOJ1599M"
        },
        "reducer": {
          "process_graph": {
            "array_element_ZPKMD8848G": {
              "process_id": "array_element",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                },
                "index": 0,
                "return_nodata": false
              }
            },
            "array_element_ZPMEJ8888R": {
              "process_id": "array_element",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                },
                "index": 1,
                "return_nodata": false
              }
            },
            "subtract_RDCCK7121G": {
              "process_id": "subtract",
              "arguments": {
                "x": {
                  "from_node": "array_element_ZPKMD8848G"
                },
                "y": {
                  "from_node": "array_element_ZPMEJ8888R"
                }
              }
            },
            "multiply_FTUUA2121D": {
              "process_id": "multiply",
              "arguments": {
                "x": 2.5,
                "y": {
                  "from_node": "subtract_RDCCK7121G"
                }
              }
            },
            "multiply_VXDJI2363O": {
              "process_id": "multiply",
              "arguments": {
                "x": 6,
                "y": {
                  "from_node": "array_element_ZPMEJ8888R"
                }
              }
            },
            "array_element_CECOT3873H": {
              "process_id": "array_element",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                },
                "index": 2,
                "return_nodata": false
              }
            },
            "multiply_SMCYD7558T": {
              "process_id": "multiply",
              "arguments": {
                "x": -7.5,
                "y": {
                  "from_node": "array_element_CECOT3873H"
                }
              }
            },
            "sum_FNEAV2096U": {
              "process_id": "sum",
              "arguments": {
                "data": [
                  {
                    "from_node": "array_element_ZPKMD8848G"
                  },
                  {
                    "from_node": "multiply_VXDJI2363O"
                  },
                  {
                    "from_node": "multiply_SMCYD7558T"
                  },
                  1
                ]
              }
            },
            "divide_FGYKO2992N": {
              "process_id": "divide",
              "arguments": {
                "x": {
                  "from_node": "multiply_FTUUA2121D"
                },
                "y": {
                  "from_node": "sum_FNEAV2096U"
                }
              },
              "result": true
            }
          }
        },
        "dimension": "bands",
        "context": null
      }
    },
    "reduce_dimension_WESWN4894Y": {
      "process_id": "reduce_dimension",
      "arguments": {
        "data": {
          "from_node": "reduce_dimension_WUGND8993F"
        },
        "reducer": {
          "process_graph": {
            "min_PPFXV4054P": {
              "process_id": "min",
              "arguments": {
                "data": {
                  "from_parameter": "data"
                }
              },
              "result": true
            }
          }
        },
        "dimension": "temporal",
        "context": null
      }
    },
    "apply_PDQLG4644T": {
      "process_id": "apply",
      "arguments": {
        "data": {
          "from_node": "reduce_dimension_WESWN4894Y"
        },
        "process": {
          "process_graph": {
            "linear_scale_range_HLCXD1417I": {
              "process_id": "linear_scale_range",
              "arguments": {
                "x": {
                  "from_parameter": "x"
                },
                "inputMin": -1,
                "inputMax": 1,
                "outputMin": 0,
                "outputMax": 255
              },
              "result": true
            }
          }
        },
        "context": null
      }
    },
    "save_result_YRUKU2642I": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "apply_PDQLG4644T"
        },
        "format": "PNG",
        "options": {}
      },
      "result": true
    }
  },
  "parameters": [
    {
      "name": "collection",
      "description": [],
      "schema": {
        "type": "string",
        "subtype": "collection-id",
        "pattern": "^[A-Za-z0-9_\\-\\.~/]+$",
        "parameters": [],
        "items": {
          "type": {}
        },
        "minItems": [],
        "maxItems": []
      }
    }
  ],
  "returns": {
    "schema": {
      "type": "boolean",
      "subtype": [],
      "pattern": [],
      "parameters": [],
      "items": {
        "type": {}
      },
      "minItems": [],
      "maxItems": []
    }
  }
}

The back-end should reject processes that have undefined parameters (i.e. no default value defined)

@m-mohr m-mohr added the bug Something isn't working label May 28, 2020
@m-mohr m-mohr self-assigned this May 28, 2020
@m-mohr
Copy link
Member Author

m-mohr commented Sep 7, 2020

fixed (was fixed in @openeo/js-processgraphs)

@m-mohr m-mohr closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant