Lee-W commented on code in PR #64615:
URL: https://github.com/apache/airflow/pull/64615#discussion_r3026306659


##########
shared/serialization/src/airflow_shared/serialization/__init__.py:
##########
@@ -41,3 +41,10 @@
         OLD_DATA,
     }
 )
+
+OLD_TYPE_TO_QUALNAME: dict[str, str] = {

Review Comment:
   ```suggestion
   OLD_TYPE_TO_FULL_QUALNAME: dict[str, str] = {
   ```
   
   https://peps.python.org/pep-3155/#naming-choice
   
   It's not just qualname. naming this way would be more accurate



##########
task-sdk/src/airflow/sdk/serde/__init__.py:
##########
@@ -307,7 +308,8 @@ def _convert(old: dict) -> dict:
         # Return old style dicts directly as they do not need wrapping
         if old[OLD_TYPE] == OLD_DICT:
             return old[OLD_DATA]
-        return {CLASSNAME: old[OLD_TYPE], VERSION: DEFAULT_VERSION, DATA: 
old[OLD_DATA]}
+        type_name = OLD_TYPE_TO_QUALNAME.get(old[OLD_TYPE], old[OLD_TYPE])
+        return {CLASSNAME: type_name, VERSION: DEFAULT_VERSION, DATA: 
old[OLD_DATA]}

Review Comment:
   ```suggestion
           return {
               CLASSNAME: OLD_TYPE_TO_QUALNAME.get(old[OLD_TYPE], 
old[OLD_TYPE]),
               VERSION: DEFAULT_VERSION,
               DATA: old[OLD_DATA],
           }
   ```
   
   The variable is not used elsewhere. probably don't need it 



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