rawwar commented on code in PR #44306:
URL: https://github.com/apache/airflow/pull/44306#discussion_r1861136824


##########
airflow/api_fastapi/core_api/datamodels/plugins.py:
##########
@@ -75,6 +75,9 @@ class PluginResponse(BaseModel):
     ti_deps: list[Annotated[str, BeforeValidator(coerce_to_string)]]
     listeners: list[str]
     timetables: list[str]
+    priority_weight_strategies: list[Any]
+    admin_views: list[Any]
+    menu_links: list[Any]

Review Comment:
   I'm not sure what types to add here.
   
   I tried to add list[type[PriorityWeightStrategy]] to 
`priority_weight_strategies`. But, its throwing following error when generating 
openapi spec.
   
   ```
   raceback (most recent call last):
     File "/opt/airflow/scripts/in_container/run_update_fastapi_api_spec.py", 
line 38, in <module>
       get_openapi(
     File "/usr/local/lib/python3.9/site-packages/fastapi/openapi/utils.py", 
line 493, in get_openapi
       field_mapping, definitions = get_definitions(
     File "/usr/local/lib/python3.9/site-packages/fastapi/_compat.py", line 
231, in get_definitions
       field_mapping, definitions = schema_generator.generate_definitions(
     File "/usr/local/lib/python3.9/site-packages/pydantic/json_schema.py", 
line 361, in generate_definitions
       self.generate_inner(schema)
     File "/usr/local/lib/python3.9/site-packages/pydantic/json_schema.py", 
line 441, in generate_inner
       if 'ref' in schema:
     File "/usr/local/lib/python3.9/_collections_abc.py", line 769, in 
__contains__
       self[key]
     File 
"/usr/local/lib/python3.9/site-packages/pydantic/_internal/_mock_val_ser.py", 
line 41, in __getitem__
       return self._get_built().__getitem__(key)
     File 
"/usr/local/lib/python3.9/site-packages/pydantic/_internal/_mock_val_ser.py", 
line 58, in _get_built
       raise PydanticUserError(self._error_message, code=self._code)
   pydantic.errors.PydanticUserError: 
`TypeAdapter[typing.Annotated[airflow.api_fastapi.core_api.datamodels.plugins.PluginCollectionResponse,
 FieldInfo(annotation=PluginCollectionResponse, required=True)]]` is not fully 
defined; you should define 
`typing.Annotated[airflow.api_fastapi.core_api.datamodels.plugins.PluginCollectionResponse,
 FieldInfo(annotation=PluginCollectionResponse, required=True)]` and all 
referenced types, then call `.rebuild()` on the instance.
   ```



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