korbit-ai[bot] commented on code in PR #34802: URL: https://github.com/apache/superset/pull/34802#discussion_r2291911179
########## superset/sqllab/validators.py: ########## @@ -17,7 +17,9 @@ # pylint: disable=too-few-public-methods from __future__ import annotations -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING + +from pyparsing import Optional Review Comment: ### Wrong Optional Import Source <sub></sub> <details> <summary>Tell me more</summary> ###### What is the issue? Incorrect import of Optional type from pyparsing instead of typing module. This will cause runtime issues as pyparsing.Optional serves a different purpose than typing.Optional. ###### Why this matters pyparsing.Optional is used for parsing grammars, while typing.Optional is needed for type hints. This will cause type checking errors and potential runtime failures. ###### Suggested change ∙ *Feature Preview* Replace the import with the correct Optional type from typing: ```python from typing import Any, Optional, TYPE_CHECKING ``` ###### Provide feedback to improve future suggestions [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/f662572d-bc64-443b-892c-9df5992824c6/upvote) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/f662572d-bc64-443b-892c-9df5992824c6?what_not_true=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/f662572d-bc64-443b-892c-9df5992824c6?what_out_of_scope=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/f662572d-bc64-443b-892c-9df5992824c6?what_not_in_standard=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/f662572d-bc64-443b-892c-9df5992824c6) </details> <sub> 💬 Looking for more details? Reply to this comment to chat with Korbit. </sub> <!--- korbi internal id:f917ad39-be1b-4bd7-8a89-2bc5d5377dfe --> [](f917ad39-be1b-4bd7-8a89-2bc5d5377dfe) -- 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]
