Move _normalize_hive_syntax to DefaultTypeConverter and fix converter pass stubs#695
Merged
laughingman7743 merged 1 commit intomasterfrom Feb 28, 2026
Merged
Conversation
e26db69 to
ea43e1e
Compare
- Move _normalize_hive_syntax from module-level function in parser.py to a staticmethod on DefaultTypeConverter, since it is only used there - Move Hive syntax tests from test_parser.py to test_converter.py to match the new location - Replace pass stubs in convert() with self.get(type_)(value) in DefaultPandasTypeConverter, DefaultPandasUnloadTypeConverter, DefaultArrowUnloadTypeConverter, and DefaultPolarsUnloadTypeConverter - Add converter tests in each subpackage (pandas, arrow, polars) Closes #692. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ea43e1e to
a8df601
Compare
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.
WHAT
_normalize_hive_syntaxfrom a module-level function inparser.pyto a@staticmethodonDefaultTypeConverter, since it is only called fromDefaultTypeConverter._parse_type_hint()passstubs inconvert()withself.get(type_)(value)in 4 converter classes:DefaultPandasTypeConverterDefaultPandasUnloadTypeConverterDefaultArrowUnloadTypeConverterDefaultPolarsUnloadTypeConverterWHY
_normalize_hive_syntaxwas a module-level function but only used byDefaultTypeConverter. Moving it to a staticmethod makes ownership clear and avoids polluting the module namespace. Other converters (Pandas/Arrow/Polars) don't need Hive syntax normalization.passstubs in converterconvert()methods silently returnedNonefor any input, which could cause data loss if these converters are ever invoked (e.g., via the_fetch_all_rowsAPI fallback path). Replacing withself.get(type_)(value)matches the pattern already used by the non-unload Arrow and Polars converters.Closes #692.