Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-7746] Add python type hints (part 2) #10367

Merged
merged 14 commits into from
Jan 14, 2020

Commits on Jan 14, 2020

  1. Configuration menu
    Copy the full SHA
    2c00922 View commit details
    Browse the repository at this point in the history
  2. [BEAM-7746] Typing fixes that require runtime code changes

    Minor adjustments to runtime code required to silence certain errors.
    
    Two common patterns:
    - explicitly return None from functions that also return non-None
    - assert that optional attributes are non-None before using them, if there are no other conditionals present to ensure this.
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    882c865 View commit details
    Browse the repository at this point in the history
  3. [BEAM-7746] Avoid creating attributes dynamically, so that they can b…

    …e statically analyzed
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    bfc6e55 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8353a28 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    29e243e View commit details
    Browse the repository at this point in the history
  6. [BEAM-7746] Generate files with protobuf urns as part of gen_protos b…

    …uild process
    
    This fixes numerous errors generated throughout the code because mypy cannot
    track the dynamic setattr binding that was done by common_urns.
    
    The change also necessitated updating a few doctrings to prevent this error:
    
    more than one target found for cross-reference u'DisplayData':
     apache_beam.transforms.display.DisplayData
     apache_beam.portability.api.beam_runner_api_pb2_urns.DisplayData
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    374db87 View commit details
    Browse the repository at this point in the history
  7. [BEAM-7746] Move name and coder to base StateSpec class

    There are several places in the code where it is assumed that these are part of the abstract StateSpec.
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    bc21b25 View commit details
    Browse the repository at this point in the history
  8. [BEAM-7746] Remove reference to missing attribute in statesampler_slo…

    …w.StateSampler.reset()
    
    statesampler_slow.StateSampler does not have _states_by_name attribute.  Only its fast counterpart does.
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    80e2c2e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9f14ce9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ee13d08 View commit details
    Browse the repository at this point in the history
  11. [BEAM-7746] Add StateHandler abstract base class

    This gives us a type that we can use to ensure all handlers meet the same protocol
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    83866ec View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    6189010 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3ff01eb View commit details
    Browse the repository at this point in the history
  14. [BEAM-7746] Fix tests that have the same name

    Note that this means that tests that were previously being masked by other
    tests with the same name will now be run.
    
    There is a fix included for one such test.
    chadrik committed Jan 14, 2020
    Configuration menu
    Copy the full SHA
    f7f8792 View commit details
    Browse the repository at this point in the history