pierrejeambrun commented on code in PR #64552:
URL: https://github.com/apache/airflow/pull/64552#discussion_r3028483417


##########
.gitignore:
##########
@@ -299,3 +299,4 @@ dev/registry/output/
 dev/registry/logos/
 dev/registry/modules.json
 dev/registry/providers.json
+.worktrees/

Review Comment:
   That's probably unrelated to this PR.



##########
airflow-core/src/airflow/api_fastapi/common/types.py:
##########
@@ -216,7 +216,11 @@ def serialize_model(self, handler: Any) -> dict:
 class Theme(BaseModel):
     """JSON to modify Chakra's theme."""
 
-    tokens: dict[Literal["colors"], ThemeColors]
+    tokens: dict[Literal["colors"], ThemeColors] | None = None
     globalCss: dict[str, dict] | None = None
     icon: ThemeIconType = None
     icon_dark_mode: ThemeIconType = None
+
+    @model_serializer(mode="wrap")
+    def serialize_model(self, handler: Any) -> dict:
+        return {k: v for k, v in handler(self).items() if v is not None}

Review Comment:
   Not sure what we are tying to achieve here.



##########
airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts:
##########
@@ -9007,59 +9007,8 @@ export const $TeamResponse = {
 } as const;
 
 export const $Theme = {
-    properties: {
-        tokens: {
-            additionalProperties: {
-                '$ref': '#/components/schemas/ThemeColors'
-            },
-            propertyNames: {
-                const: 'colors'
-            },
-            type: 'object',
-            title: 'Tokens'
-        },
-        globalCss: {

Review Comment:
   Here the validator in the model above makes us loose typing information. If 
it's not needed we can just remove the validator altogther or use a normal 
validator (not wrap) to not lose the types



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