Skip to content

Fix test resources and List type handling in test_dl_tensorflow#728

Open
Harshakamalur wants to merge 1 commit intoapache:mainfrom
Harshakamalur:fix/issue-630-dl-test
Open

Fix test resources and List type handling in test_dl_tensorflow#728
Harshakamalur wants to merge 1 commit intoapache:mainfrom
Harshakamalur:fix/issue-630-dl-test

Conversation

@Harshakamalur
Copy link

Summary

Fixes #630

This PR fixes the previously skipped test_dl_tensorflow test by addressing both issues mentioned in the issue: missing test resources and type errors with nested lists.

Changes

  • python/src/pywy/tests/test_dl.py

    • Removed @pytest.mark.skip decorator
    • Replaced hardcoded /var/www/html/ paths with importlib.resources pointing to proper bundled test resources
    • Fixed incorrect type annotation: floats: List[List[int]]List[List[float]]
  • python/src/pywy/types.py

    • Fixed typecheck() to use get_origin() instead of isinstance() for correct handling of nested generic types like List[List[float]]
    • isinstance(input_type, List) does not work for typing generics; get_origin(input_type) is list is the correct approach

Test Result

The test now runs and successfully constructs the full computation plan. The ConnectionError at the end is expected behavior, executing the plan requires a running Wayang backend server, which is outside the scope of this fix.

Future Improvements

  • The ConnectionError at execution time could be addressed in a follow-up by mocking the backend connection or adding a @pytest.mark.integration marker to separate unit and integration tests.

Related

Closes #630

@Harshakamalur
Copy link
Author

Hi @apache/wayang-committers, I've submitted this PR to fix #630. Could you please assign this to me and approve the workflows so the CI can run?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix this test by giving it proper test resources & fixing some type issues with ...

1 participant