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

Apply PEP 604 union type syntax codemod #2561

Closed
wants to merge 1 commit into from

Conversation

Balandat
Copy link
Contributor

@Balandat Balandat commented Oct 1, 2024

This codemods all Optional[X] type definitions to use the PEP 604 syntax X | None instead.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 1, 2024
@Balandat Balandat requested a review from esantorella October 1, 2024 23:14
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (68faeff) to head (71b14e0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2561      +/-   ##
==========================================
- Coverage   99.98%   99.98%   -0.01%     
==========================================
  Files         193      193              
  Lines       17111    17071      -40     
==========================================
- Hits        17108    17068      -40     
  Misses          3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Balandat Balandat force-pushed the pep604 branch 3 times, most recently from f2860e5 to 4cbda31 Compare October 1, 2024 23:30
Copy link
Member

@esantorella esantorella left a comment

Choose a reason for hiding this comment

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

Thanks!

@facebook-github-bot
Copy link
Contributor

@Balandat has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63733395

Balandat added a commit to Balandat/botorch that referenced this pull request Oct 2, 2024
Summary:
This codemods all `Optional[X]` type definitions to use the PEP 604 syntax `X | None` instead. I also ran ufmt to fix the imports.

Why? I came across https://github.com/asottile/pyupgrade randomly and figured I'd give it a shot...

This is mostly to test that everything runs smoothly. This may be kind of a pain to rebase on so not sure we should merge this in in one big chunk...

Pull Request resolved: pytorch#2561

Reviewed By: esantorella

Differential Revision: D63733395

Pulled By: Balandat
Summary:
This codemods all `Optional[X]` type definitions to use the PEP 604 syntax `X | None` instead. I also ran ufmt to fix the imports.

Why? I came across https://github.com/asottile/pyupgrade randomly and figured I'd give it a shot...

This is mostly to test that everything runs smoothly. This may be kind of a pain to rebase on so not sure we should merge this in in one big chunk...

Pull Request resolved: pytorch#2561

Reviewed By: esantorella

Differential Revision: D63733395

Pulled By: Balandat
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63733395

@facebook-github-bot
Copy link
Contributor

@Balandat merged this pull request in a0a2c05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants