Skip to content

[dict] Raise TypeError in dict methods #154003

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

Closed

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented May 21, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/154003

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 Cancelled Jobs

As of commit 18fa49f with merge base 524e827 (image):

CANCELLED JOBS - The following jobs were cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

guilhermeleobas added a commit that referenced this pull request May 21, 2025
ghstack-source-id: 2df6189
Pull Request resolved: #154003
guilhermeleobas added a commit that referenced this pull request May 21, 2025
ghstack-source-id: 2df6189
Pull Request resolved: #154003
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request May 26, 2025
ghstack-source-id: 29a7c3c
Pull Request resolved: #154003
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request May 27, 2025
ghstack-source-id: f9bb119
Pull Request resolved: #154003
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request May 29, 2025
ghstack-source-id: c4f2aa0
Pull Request resolved: #154003
[ghstack-poisoned]
@guilhermeleobas guilhermeleobas changed the title [Dynamo] [wip] Fixes for dict [Dynamo] [dict] Raise TypeError in dict methods May 31, 2025
[ghstack-poisoned]
@guilhermeleobas guilhermeleobas changed the title [Dynamo] [dict] Raise TypeError in dict methods [dict] Raise TypeError in dict methods Jun 2, 2025
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@@ -567,9 +602,10 @@ def call_method(
elif name == "__or__":
assert len(args) == 1
if not isinstance(args[0], ConstDictVariable):
raise TypeError(
msg = ConstantVariable.create(
f"unsupported operand type(s) for |: 'dict' and '{args[0].python_type().__name__}'"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use python_type_name() instead

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
msg = ConstantVariable.create(
"fromkeys expected at least 1 arguments, got 0"
)
raise_observed_exception(TypeError, tx, args=[msg])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you added the exception raising stuff after I last worked on Dynamo. that's really cool!

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #154943

pytorchmergebot pushed a commit that referenced this pull request Jul 10, 2025
pytorchmergebot pushed a commit that referenced this pull request Jul 10, 2025
pytorchmergebot pushed a commit that referenced this pull request Jul 10, 2025
pytorchmergebot pushed a commit that referenced this pull request Jul 10, 2025
@github-actions github-actions bot deleted the gh/guilhermeleobas/149/head branch August 10, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants