[ 
https://issues.apache.org/jira/browse/BEAM-6877?focusedWorklogId=283531&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-283531
 ]

ASF GitHub Bot logged work on BEAM-6877:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jul/19 18:08
            Start Date: 26/Jul/19 18:08
    Worklog Time Spent: 10m 
      Work Description: udim commented on pull request #8893: [BEAM-6877] 
trivial_inference: make remaining tests pass
URL: https://github.com/apache/beam/pull/8893#discussion_r307853447
 
 

 ##########
 File path: sdks/python/apache_beam/typehints/trivial_inference.py
 ##########
 @@ -458,10 +458,18 @@ def infer_return_type_func(f, input_types, debug=False, 
depth=0):
           pop_count = arg + 2
           return_type = Any
         elif opname == 'CALL_FUNCTION_EX':
-          # TODO(udim): Handle variable argument lists. Requires handling 
kwargs
-          #   first.
-          pop_count = (arg & 1) + 3
-          return_type = Any
+          has_kwargs = arg & 1  # type: int
+          pop_count = has_kwargs + 1
+          if has_kwargs:
+            # TODO(udim): Unimplemented. Requires same functionality as a
+            #   CALL_FUNCTION_KW implementation.
+            return_type = Any
+          else:
+            args_and_callable = state.stack[-1]
 
 Review comment:
   I think you're right.
   The only test cases I had so far had BUILD_TUPLE_UNPACK_WITH_CALL followed 
by CALL_FUNCTION_EX. I've added an additional test case.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 283531)
    Time Spent: 11h 50m  (was: 11h 40m)

> TypeHints Py3 Error: Type inference tests fail on Python 3.6 due to bytecode 
> changes
> ------------------------------------------------------------------------------------
>
>                 Key: BEAM-6877
>                 URL: https://issues.apache.org/jira/browse/BEAM-6877
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Robbe
>            Assignee: Udi Meiri
>            Priority: Major
>          Time Spent: 11h 50m
>  Remaining Estimate: 0h
>
> Type inference doesn't work on Python 3.6 due to [bytecode to wordcode 
> changes|https://docs.python.org/3/whatsnew/3.6.html#cpython-bytecode-changes].
> Type inference always returns Any on Python 3.6, so this is not critical.
> Affected tests are:
>  *transforms.ptransform_test*:
>  - test_combine_properly_pipeline_type_checks_using_decorator
>  - test_mean_globally_pipeline_checking_satisfied
>  - test_mean_globally_runtime_checking_satisfied
>  - test_count_globally_pipeline_type_checking_satisfied
>  - test_count_globally_runtime_type_checking_satisfied
>  - test_pardo_type_inference
>  - test_pipeline_inference
>  - test_inferred_bad_kv_type
> *typehints.trivial_inference_test*:
>  - all tests in TrivialInferenceTest
> *io.gcp.pubsub_test.TestReadFromPubSubOverride*:
> * test_expand_with_other_options
> * test_expand_with_subscription
> * test_expand_with_topic



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to