You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Robert Bradshaw (JIRA)" <ji...@apache.org> on 2018/10/15 07:53:00 UTC

[jira] [Commented] (BEAM-5621) Several tests fail on Python 3 with TypeError: unorderable types: str() < int()

    [ https://issues.apache.org/jira/browse/BEAM-5621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16649857#comment-16649857 ] 

Robert Bradshaw commented on BEAM-5621:
---------------------------------------

A proper fix would to not require sortability. (This has actually come up before, we should accept a list of matchers and determine if any permutation of the inputs satisfies them, which can be done in O(n^2) applications + O(n^3) arithmetic time. 

Note that this is not just an issue for Python long, but ints vs. floats, and any other objects that may compare equal across types. 

In the short term, perhaps a quick hack is to try sort + compare, and that failing, fall back to the type-aware sort + compare, and also clearly indicate that this is not promised to be backwards compatible. 

> Several tests fail on Python 3 with TypeError: unorderable types: str() < int()
> -------------------------------------------------------------------------------
>
>                 Key: BEAM-5621
>                 URL: https://issues.apache.org/jira/browse/BEAM-5621
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Valentyn Tymofieiev
>            Assignee: Juta Staes
>            Priority: Major
>             Fix For: Not applicable
>
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> ======================================================================
> ERROR: test_remove_duplicates (apache_beam.transforms.ptransform_test.PTransformTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/runners/common.py", line 677, in process
>     self.do_fn_invoker.invoke_process(windowed_value)
>   File "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/runners/common.py", line 414, in invoke_process
>     windowed_value, self.process_method(windowed_value.value))
>   File "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/transforms/core.py", line 1068, in <lambda>
>     wrapper = lambda x: [fn(x)]
>   File "/usr/local/google/home/valentyn/projects/beam/clean_head/beam/sdks/python/apache_beam/testing/util.py", line 115, in _equal
>     sorted_expected = sorted(expected)
> TypeError: unorderable types: str() < int()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)