Skip to content

Python unit tests fail with new proto files #448

Closed

Description

@Yanson

In our CI pipeline, we regenerate all sources rather than relying on committed files. This is causing master build failures since this commit: #438

Expected Behavior

Build and tests pass

Current Behavior

Unit test python fails

Steps to reproduce

  1. Re-generate python files with cd protos; make gen-python
  2. Run unit tests with cd sdk/python; pip install -r requirements-ci.txt && pip install -e . && pytest --junitxml=python-sdk-test-report.xml

Specifications

latest master

Possible Solution

Add required dependencies to requirements. tensorflow_metadata?

Activity

  1. Yanson commented on Jan 28, 2020

    @Yanson
    ContributorAuthor

    Build log from Cloud Build step:

    - id: gen-proto-python
      waitFor: ['-']
      name: 'gcr.io/my-org/protoc-python'
      dir: '/workspace/protos'
      entrypoint: make
      args: ['gen-python']
    - id: unit-test-python-sdk
      waitFor: ['gen-proto-python']
      name: 'python:3.7-buster'
      dir: '/workspace/sdk/python'
      entrypoint: sh
      args: ['-c', 'pip install -r requirements-ci.txt && pip install -e . && pytest --junitxml=/log/python-sdk-test-report.xml']

    unit-test-python-sdk.txt

    Excerpt:

    ImportError while importing test module '/workspace/sdk/python/tests/test_client.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    tests/test_client.py:23: in <module>
        import feast.core.CoreService_pb2_grpc as Core
    feast/__init__.py:9: in <module>
        from .client import Client
    feast/client.py:32: in <module>
        from feast.core.CoreService_pb2 import (
    feast/core/CoreService_pb2.py:16: in <module>
        from feast.core import FeatureSet_pb2 as feast_dot_core_dot_FeatureSet__pb2
    feast/core/FeatureSet_pb2.py:21: in <module>
        from tensorflow_metadata.proto.v0 import schema_pb2 as tensorflow__metadata_dot_proto_dot_v0_dot_schema__pb2
    E   ModuleNotFoundError: No module named 'tensorflow_metadata'
    
  2. woop commented on Jan 29, 2020

    @woop
    Member

    Aha, well caught. Your approach is actually the right way to do it.

    Will keep this issue open until we have submitted a PR to fix

    1. Module import
    2. Proto building
  3. woop commented on Mar 28, 2020

    @woop
    Member

    @Yanson I believe this is resolved. Please let me know if we should reopen.

  4. IraO commented on Apr 8, 2020

    @IraO

    @woop Hi, I tried to run the example notebook (basic.ipynb) but I got this error: "ModuleNotFoundError: No module named 'feast.core'" at Step 2 (Import necessary modules)

  5. Basma-Elsaify commented on Apr 21, 2020

    @Basma-Elsaify

    @woop same for me "ModuleNotFoundError: No module named 'feast.core'" whenever I try to import any feast module.
    _ I think I need to run "make compile-protos-python" _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions