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

assertDictContainsSubset was removed in Python 3.11 #4542

Closed
tirkarthi opened this issue Dec 22, 2021 · 4 comments
Closed

assertDictContainsSubset was removed in Python 3.11 #4542

tirkarthi opened this issue Dec 22, 2021 · 4 comments

Comments

@tirkarthi
Copy link

System information

  • Have I specified the code to reproduce the issue (Yes, No):
  • Environment in which the code is executed (e.g., Local(Linux/MacOS/Windows),
    Interactive Notebook, Google Cloud, etc):
  • TensorFlow version:
  • TFX Version: master
  • Python version: 3.11
  • Python dependencies (from pip freeze output):

Describe the current behavior

The deprecated unittest aliases were removed in python/cpython#28268 in Python 3.11 . Something like change from below could be used

pytest-dev/unittest2pytest@44ea691#diff-81d91975b2e0c0c35f9575e76be3763f82c94c3365f016ed71aa39e567762630R276

tfx/tfx/components/infra_validator/model_server_runners/local_docker_runner_test.py:    self.assertDictContainsSubset(dict(
tfx/tfx/extensions/google_cloud_ai_platform/runner_test.py:    self.assertDictContainsSubset(
tfx/tfx/extensions/google_cloud_ai_platform/runner_test.py:    self.assertDictContainsSubset(
tfx/tfx/extensions/google_cloud_ai_platform/runner_test.py:    self.assertDictContainsSubset(
tfx/tfx/extensions/google_cloud_ai_platform/runner_test.py:    self.assertDictContainsSubset(
tfx/tfx/extensions/google_cloud_ai_platform/runner_test.py:    self.assertDictContainsSubset(
tfx/tfx/extensions/google_cloud_ai_platform/runner_test.py:    self.assertDictContainsSubset(user_provided_labels, body['labels'])

Describe the expected behavior

@pindinagesh pindinagesh self-assigned this Dec 22, 2021
@pindinagesh
Copy link
Contributor

pindinagesh commented Dec 23, 2021

@tirkarthi

Could you please elaborate more about this issue clearly?

@tirkarthi
Copy link
Author

The method assertDictContainsSubset from unittest.TestCase was deprecated and removed in Python 3.11 . So running these tests in Python 3.11 will give AttributeError.

@zhitaoli
Copy link
Contributor

zhitaoli commented Feb 2, 2022

Recent commit 010e94d should have fixed this and would be released in upcoming version.

@zhitaoli zhitaoli closed this as completed Feb 2, 2022
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

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

No branches or pull requests

3 participants