Copilot commented on code in PR #65014:
URL: https://github.com/apache/airflow/pull/65014#discussion_r3066477072


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py:
##########
@@ -53,16 +53,16 @@ def redact_password(cls, v: str | None, field_info: 
ValidationInfo) -> str | Non
     @field_validator("extra", mode="before")
     @classmethod
     def redact_extra(cls, v: str | None) -> str | None:
-        if v is None:
-            return None
+        if v is None or v == "":
+            return v
         try:
             extra_dict = json.loads(v)
             redacted_dict = redact(extra_dict)
             return json.dumps(redacted_dict)
         except json.JSONDecodeError:
             # Do not return un-redacted extra because this could cause 
sensitive information to be exposed.
-            # This code path should never been hit as 
``Connection._validate_extra`` sure that ``extra`` is
-            # always a valid JSON string. We add this safeguard just in case 
and to make the coupling
+            # This code path should never been hit as 
``Connection._validate_extra`` makes sure that ``extra`` is

Review Comment:
   The comment has a grammatical error: "should never been hit" should be 
"should never be hit" (or "should never be reached"). Since these lines were 
updated, please fix the wording for clarity.
   ```suggestion
               # This code path should never be hit as 
``Connection._validate_extra`` makes sure that ``extra`` is
   ```



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