Skip to content

TYP: fix mypy ignored error in pandas/compat/numpy/function.py #50104

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

Conversation

JasmandeepKaur
Copy link
Contributor


validate_argsort_kind(args, kwargs, max_fname_arg_count=3)
# error: Incompatible return value type (got "int", expected "bool")
return ascending # type: ignore[return-value]
return ascend
Copy link
Member

Choose a reason for hiding this comment

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

this isn't defined in the False case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I remove the variable and return True instead?

Copy link
Member

Choose a reason for hiding this comment

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

you'll need to make sure ascend is defined in the False case

@JasmandeepKaur
Copy link
Contributor Author

@jbrockmendel I pushed up a change for the false case for ascend. Let me know your thoughts.

@@ -192,12 +192,12 @@ def validate_clip_with_axis(
args = (axis,) + args
# error: Incompatible types in assignment (expression has type "None",
# variable has type "Union[ndarray[Any, Any], str, int]")
axis = None # type: ignore[assignment]
axes = None # type: ignore[assignment]
Copy link
Member

Choose a reason for hiding this comment

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

same thing here, you need to make srue axes is defined in the other case

@jbrockmendel
Copy link
Member

try running the test suite locally before pushing. itll help identify problems with a faster turnaround

@JasmandeepKaur
Copy link
Contributor Author

Got it. Thanks!

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jan 13, 2023
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants