zhengruifeng commented on PR #37369: URL: https://github.com/apache/spark/pull/37369#issuecomment-1202009196
I think this is a more general problem: ``` def nsmallest(self, n: int = 5) ``` this method already hint the input type, but given a boolean it will fail with a `AnalysisException` (which should be a `TypeError`). I guess it could accept a floating number like 5.5, and run successfully. I did a quick investigation of [`typing`](https://docs.python.org/3/library/typing.html#module-typing), there is an annotation `@typing.runtime_checkable`, but only works for `class typing.Protocol` is there some method to enforce the input type checking? @zero323 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
