Chore: clean tokenizer/dialect code from **opts, and minor typing improvements#7422
Merged
georgesittas merged 5 commits intotobymao:mainfrom Apr 1, 2026
Merged
Conversation
…` methods, it was dead code
- Import {Dialect, Hive, Trino} from correct modules to help LSP's catch errors (star imports at folder level cause issues for them)
- Add `object` annotation for `**kwargs`
- Delete dead code for method overloads who were asssigning values to kwargs, that weren't used afterwards
- Clean up the `__init__()` method of the Tokenizer by avoiding unused args and kwargs and overall making the code more concise
- added a few types annotations in Tokenizer base classes - import Dialect from correct module for LSP's - deleted the unused `**opts` argument from `Tokenizer.__init__()` - lint fix for unused typing import in athena dialect
geooo109
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a follow up of this comment.
**optsfor tokenizer was an unused argument across all the chain.This is now cleaned up, and allowed at the same time to delete various methods overrides in the
Athenadialect ->the dict assignements inside those methods weren't used at all later, and this is easily provable since now the base classes methods are strongly typed, hence we know that those keys aren't called anywhere.
This should also bring very minor performance improvements, thanks to avoiding various useless dict unpackings.
I also took this opportunity to bring minor typing improvements who were close to my changes.
Note that it's preferrable to NOT import types from modules with star imports, as this completely block LSP's (pyright at the very least) from resolving the symbols.
This is why a few import lines have been changed as well.