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 #2808

Closed
wants to merge 1 commit into from

Conversation

Balandat
Copy link
Contributor

@Balandat Balandat commented Oct 2, 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 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 97.50000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 95.71%. Comparing base (78b0527) to head (4cd0ffe).
Report is 369 commits behind head on main.

Files with missing lines Patch % Lines
ax/plot/diagnostic.py 20.00% 4 Missing ⚠️
ax/plot/trace.py 20.00% 4 Missing ⚠️
ax/metrics/factorial.py 33.33% 2 Missing ⚠️
ax/plot/scatter.py 84.61% 2 Missing ⚠️
ax/utils/flake8_plugins/docstring_checker.py 0.00% 2 Missing ⚠️
ax/core/outcome_constraint.py 66.66% 1 Missing ⚠️
ax/plot/bandit_rollout.py 0.00% 1 Missing ⚠️
ax/plot/render.py 0.00% 1 Missing ⚠️
ax/service/ax_client.py 91.66% 1 Missing ⚠️
ax/storage/sqa_store/save.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2808   +/-   ##
=======================================
  Coverage   95.71%   95.71%           
=======================================
  Files         490      490           
  Lines       48555    48532   -23     
=======================================
- Hits        46472    46451   -21     
+ Misses       2083     2081    -2     

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

@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: D63764095

Balandat added a commit to Balandat/Ax 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.

Pull Request resolved: facebook#2808

Reviewed By: mpolson64

Differential Revision: D63764095

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

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

Balandat added a commit to Balandat/Ax 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.

Pull Request resolved: facebook#2808

Reviewed By: mpolson64

Differential Revision: D63764095

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

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

Balandat added a commit to Balandat/Ax 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.

Pull Request resolved: facebook#2808

Reviewed By: mpolson64

Differential Revision: D63764095

Pulled By: Balandat
Balandat added a commit to Balandat/Ax 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.

Pull Request resolved: facebook#2808

Reviewed By: mpolson64

Differential Revision: D63764095

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

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

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

Pull Request resolved: facebook#2808

Reviewed By: mpolson64

Differential Revision: D63764095

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

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

@facebook-github-bot
Copy link
Contributor

@Balandat merged this pull request in 33333d2.

Balandat added a commit to Balandat/Ax that referenced this pull request Oct 3, 2024
facebook#2808 moved to PEP604 optional type annotiation. Apparently this broke some code that worked fined wiht the previously used `Optional[DBSettings]` even if `DBSettings` was not defined. I'm not entirely sure what's going on; this is more than about just delayed type annotations. Anyway, this is a hotfix that returns that code to the previous state.
facebook-github-bot pushed a commit that referenced this pull request Oct 3, 2024
Summary:
#2808 moved to PEP604 optional type annotiation. Apparently this broke some code that worked fined wiht the previously used `Optional[DBSettings]` even if `DBSettings` was not defined. I'm not entirely sure what's going on; this is more than about just delayed type annotations. Anyway, this is a hotfix that returns that code to the previous state.

Pull Request resolved: #2819

Reviewed By: saitcakmak

Differential Revision: D63834254

Pulled By: Balandat

fbshipit-source-id: 9ca80b263816d4bae9451375d5cd212752ed23c8
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