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

[Mypy] Refactor code ahead of mypy fixes #1245

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfc-gh-jrose
Copy link
Contributor

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes #NNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

This PR refactors some of the code to make it a little easier to apply mypy annotations later.

@sfc-gh-jrose sfc-gh-jrose added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Feb 8, 2024
@sfc-gh-jrose sfc-gh-jrose marked this pull request as ready for review February 9, 2024 17:33
@sfc-gh-jrose sfc-gh-jrose requested a review from a team as a code owner February 9, 2024 17:33
installed_pandas
and return_type
and return_type_from_type_hints
and input_types is not None
Copy link
Collaborator

Choose a reason for hiding this comment

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

This condition is new for this if-statement. Is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is intentional. The below code fails if input_types is None so in practice I don't think it ever is None, but mypy does not pick up on that and complains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants