You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/01/23 13:22:05 UTC
[airflow] 11/24: Fix example code in Doc (#19824)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 4608eaa77d7cc77f45ab6046bc7470a39fcc2f37
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Thu Nov 25 17:06:41 2021 +0100
Fix example code in Doc (#19824)
(cherry picked from commit 76c598a52e084a99dba4441c326be52d1c26634c)
---
docs/apache-airflow/concepts/params.rst | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/docs/apache-airflow/concepts/params.rst b/docs/apache-airflow/concepts/params.rst
index 430de5d..c508279 100644
--- a/docs/apache-airflow/concepts/params.rst
+++ b/docs/apache-airflow/concepts/params.rst
@@ -32,21 +32,22 @@ which won't be doing any such validations.
from airflow.models.param import Param
with DAG(
- 'my_dag',
- params: {
- 'int_param': Param(10, type='integer', minimum=0, maximum=20), # a int param with default value
- 'str_param': Param(type='string', minLength=2, maxLength=4), # a mandatory str param
- 'dummy_param': Param(type=['null', 'number', 'string']) # a param which can be None as well
- 'old_param': 'old_way_of_passing', # i.e. no data or type validations
- 'simple_param': Param('im_just_like_old_param'), # i.e. no data or type validations
- 'email_param': Param(
- default='example@example.com',
- type='string',
- format='idn-email',
- minLength=5,
- maxLength=255,
- ),
- }
+ 'my_dag',
+ params={
+ 'int_param': Param(10, type='integer', minimum=0, maximum=20), # a int param with default value
+ 'str_param': Param(type='string', minLength=2, maxLength=4), # a mandatory str param
+ 'dummy_param': Param(type=['null', 'number', 'string']) # a param which can be None as well
+ 'old_param': 'old_way_of_passing', # i.e. no data or type validations
+ 'simple_param': Param('im_just_like_old_param'), # i.e. no data or type validations
+ 'email_param': Param(
+ default='example@example.com',
+ type='string',
+ format='idn-email',
+ minLength=5,
+ maxLength=255,
+ ),
+ },
+ )
``Param`` make use of `json-schema <https://json-schema.org/>`__ to define the properties and doing the
validation, so one can use the full json-schema specifications mentioned at