[
https://issues.apache.org/jira/browse/BEAM-6985?focusedWorklogId=239913&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-239913
]
ASF GitHub Bot logged work on BEAM-6985:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/May/19 19:57
Start Date: 09/May/19 19:57
Worklog Time Spent: 10m
Work Description: tvalentyn commented on pull request #8453: [BEAM-6985]
TypeHints Py3 Error: Native type compatibility tests fail on Python 3.7+ Updates
URL: https://github.com/apache/beam/pull/8453#discussion_r282582165
##########
File path: sdks/python/apache_beam/typehints/native_type_compatibility.py
##########
@@ -95,8 +101,15 @@ def _match_issubclass(match_against):
def _match_same_type(match_against):
# For Union types. They can't be compared with isinstance either, so we
- # have to compare their types directly.
- return lambda user_type: type(user_type) == type(match_against)
+ # Have to compare their types directly.
Review comment:
Looks like _match_same_type is used for Union and Any types, so this comment
(lines 103-104) is a little misleading. Of course, this problem was here before
your change, but we can improve this codebase a little bit since we are
touching it. This comment would be more useful if we move it to line 160.
Also line 104 is a continuation of the sentence in line 103, so we don't
need to start it with a capital letter.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 239913)
Time Spent: 3h 40m (was: 3.5h)
> TypeHints Py3 Error: Native type compatibility tests fail on Python 3.7+
> ------------------------------------------------------------------------
>
> Key: BEAM-6985
> URL: https://issues.apache.org/jira/browse/BEAM-6985
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Reporter: Robbe
> Assignee: niklas Hansson
> Priority: Major
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> The following tests are failing:
> * test_convert_nested_to_beam_type
> (apache_beam.typehints.native_type_compatibility_test.NativeTypeCompatibilityTest)
>
> * test_convert_to_beam_type
> (apache_beam.typehints.native_type_compatibility_test.NativeTypeCompatibilityTest)
>
> * test_convert_to_beam_types
> (apache_beam.typehints.native_type_compatibility_test.NativeTypeCompatibilityTest)
> With similar errors, where `typing.<Type> != <Type>`. eg:
> {noformat}
> FAIL: test_convert_to_beam_type
> (apache_beam.typehints.native_type_compatibility_test.NativeTypeCompatibilityTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/typehints/native_type_compatibility_test.py",
> line 79, in test_convert_to_beam_type
> beam_type, description)
> AssertionError: typing.Dict[bytes, int] != Dict[bytes, int] : simple dict
> {noformat}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)