subkanthi edited a comment on issue #20442:
URL: https://github.com/apache/airflow/issues/20442#issuecomment-1006075195


   The problem is here in this line, because the value is of type 'str' and so 
the `not isinstance` isnt working as expected.
   
   ```
           # If we have a value, validate it once. May raise ValueError.
           if not isinstance(value, ArgNotSet):
               try:
                   jsonschema.validate(value, schema, 
format_checker=FormatChecker())
               except ValidationError as err:
                   raise ValueError(err)
   ```
   
   <img width="1247" alt="Screen Shot 2022-01-05 at 4 01 44 PM" 
src="https://user-images.githubusercontent.com/17434846/148288963-ff3b4950-16e3-47d6-aa2d-b3775e9fd35e.png";>
   
   Looks like it reads the default as a string from data.
   `| {"dag": {"tasks": [{"pool": "default_pool", "label": "task1", "params": 
{"wd": {"schema": {"__var": {"type": "number"}, "__type": "dict"}, "__class": 
"airflow.models.param.Param", "default": "<airflow.utils.types.ArgNotSet object 
at 0xffff7b0c0588>", "description": "demo numeric param"}}, "_inlets": [], 
"task_id": "task1", "_outlets": [], "ui_color": "#e8f7e4", "_is_dummy": true, 
"_task_type": "DummyOperator", "start_date": 1623801600.0, "ui_fgcolor": 
"#000", "_task_module": "airflow.operators.dummy", "template_ext": [], 
"template_fields": [], "_downstream_task_ids": [], "template_fields_renderers": 
{}}], "params": {"wd": {"schema": {"__var": {"type": "number"}, "__type": 
"dict"}, "__class": "airflow.models.param.Param", "default": 
"<airflow.utils.types.ArgNotSet object at 0xffff8959f0b8>", "description": 
"demo numeric param"}}, "_dag_id": "mydag", "catchup": false, "fileloc": 
"/home/parallels/Documents/GITHUB/airflow/airflow/example_dags/example_test_dag.py",
 "timezone": "UTC"
 , "edge_info": {}, "_task_group": {"tooltip": "", "children": {"task1": 
["operator", "task1"]}, "ui_color": "CornflowerBlue", "_group_id": null, 
"ui_fgcolor": "#000", "prefix_group_id": true, "upstream_task_ids": [], 
"upstream_group_ids": [], "downstream_task_ids": [], "downstream_group_ids": 
[]}, "default_args": {"__var": {"start_date": {"__var": 1623801600.0, "__type": 
"datetime"}, "depends_on_past": false}, "__type": "dict"}, "dag_dependencies": 
[], "schedule_interval": null}, "__version": 1} |
   `


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to