You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jens-scheffler-bosch (via GitHub)" <gi...@apache.org> on 2023/07/22 15:08:51 UTC

[GitHub] [airflow] jens-scheffler-bosch commented on a diff in pull request #32734: Add support for arrays of different data types in the Trigger Form UI

jens-scheffler-bosch commented on code in PR #32734:
URL: https://github.com/apache/airflow/pull/32734#discussion_r1271306720


##########
docs/apache-airflow/core-concepts/params.rst:
##########
@@ -190,7 +190,8 @@ The following features are supported in the Trigger UI Form:
     - ``boolean``: Generates a toggle button to be used as ``True`` or ``False``.
     - ``date``, ``datetime`` and ``time``: Generate date and/or time picker
     - ``array``: Generates a HTML multi line text field, every line edited will be made into a string array as value.
-      if you add the attribute ``example`` with a list, a multi-value select option will be generated.
+      If you add the attribute ``example`` with a list, a multi-value select option will be generated.
+      If you add the attribute ``items``, a JSON entry field will be generated for more complex array types.

Review Comment:
   Can you add a reference to JSON specs?
   ```suggestion
         If you add the attribute ``items``, a JSON entry field will be generated for more array types
         and additional type validation as described in
         `JSON Schema Array Items<https://json-schema.org/understanding-json-schema/reference/array.html#items>`_.
   ```



##########
airflow/example_dags/example_params_ui_tutorial.py:
##########
@@ -208,6 +216,18 @@
             title="JSON entry field",
             section="Special advanced stuff with form fields",
         ),
+        "array_of_objects": Param(
+            [{"name": "account_name", "country": "country_name"}],
+            "Array with complex objects and validation rules",

Review Comment:
   A link to JSON Schema specs might be useful here as well.
   ```suggestion
               "Array with complex objects and validation rules. "
               "See <a href='https://json-schema.org/understanding-json-schema"
               "/reference/array.html#items'>JSON Schema validation options in specs.</a>",
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org