tirkarthi commented on PR #49844:
URL: https://github.com/apache/airflow/pull/49844#issuecomment-2838482781

   `JsonValue` is defined as a type alias and it should accept `str` as a type 
inside the union. I am not sure why mypy complains. Since the file is 
`generated.py` do I need to generate something here?
   
   VariableBody definition 
   
   
https://github.com/apache/airflow/blob/61e45b270918f892937f62c321f9234f512f71c5/airflow-ctl/src/airflowctl/api/datamodels/generated.py#L831-L841
   
   Error
   
   ```
   airflow-ctl/tests/airflow_ctl/api/test_operations.py:666: error: Argument
   "value" to "VariableBody" has incompatible type "str"; expected "JsonValue" 
   [arg-type]
               value=value,
                     ^~~~~
   Found 1 error in 1 file (checked 26 source files)
   Error 1 returned
   ```
   
   
https://github.com/pydantic/pydantic/blob/797fe31a87df5b707f29b440c9d189914d531ea7/pydantic/types.py#L2730-L2738
   
   ```
   JsonValue: TypeAlias = Union[
       List["JsonValue"],
       Dict[str, "JsonValue"],
       str,
       bool,
       int,
       float,
       None,
   ]
   ```


-- 
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