forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix example code in Doc (apache#19824)
- Loading branch information
1 parent
5482b6a
commit 76c598a
Showing
1 changed file
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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='[email protected]', | ||
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='[email protected]', | ||
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 | ||
|