You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/18 03:54:43 UTC

[GitHub] [flink] shuiqiangchen commented on a change in pull request #14401: [FLINK-20621][python] Refactor the TypeInformation implementation in Python DataStream API.

shuiqiangchen commented on a change in pull request #14401:
URL: https://github.com/apache/flink/pull/14401#discussion_r545557068



##########
File path: flink-python/pyflink/common/typeinfo.py
##########
@@ -407,12 +406,12 @@ def to_internal_type(self, obj):
                 raise ValueError("Unexpected tuple %r with RowTypeInfo" % obj)
         else:
             if isinstance(obj, dict):
-                return tuple(obj.get(n) for n in self._j_typeinfo.getFieldNames())
+                return tuple(obj.get(n) for n in self.field_names)

Review comment:
       Here we should appy obj.get(field_name), it would return None if the field_name does not present in the obj while applying obj[field_name] will get a KeyError.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org