fix: four API-level bug fixes#69
Closed
martinv13 wants to merge 2 commits into
Closed
Conversation
- DataModel._build_model: table-name validation iterated over self.model_config (which has no "tables" key after _validate_config) instead of self.tables_config, so the guard was silently dead and unknown table names in model_config were never caught - XMLConverter.parse_xml: skip_validation defaulted to False (validate) while Document.parse_xml and DataModel.parse_xml both default to True (skip); aligns the low-level default with the documented behaviour and with how the method is always called by its callers - DatabaseDialect.db_identifier: remove the dead temp_prefix parameter which was never passed by any caller and whose implementation (max_len += 14) was the inverse of what its docstring described - DataModelColumn: rename the model_config constructor argument and attribute to config to reflect that it holds the table-level config dict, not the top-level model config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes four bugs identified during a documentation audit.
_build_model iteratedoverself.model_config.get("tables", {}), but_validate_config stripsthe "tables" key fromself.model_config, so the loop was always empty.Unknown table names passed in model_config were accepted without error. Fixed by iterating over
self.tables_configinstead.XMLConverter.parse_xmlskip_validation default was inverted. The low-level method defaulted to False (validate), whileDocument.parse_xmlandDataModel.parse_xmlboth default to True (skip), matching the documentedbehaviour. Anyone calling
XMLConverter.parse_xmldirectly without the keyword argument got silent validation. Aligned to True.DatabaseDialect.db_identifiercarried a deadtemp_prefixparameter. It was never passed by any caller anywhere in the codebase. Its implementation (max_len += 14) was also the inverse of its stated intent ("save 14characters for the prefix"). Removed.
DataModelColumn.model_configwas a misnomer. The attribute stores the table-level config dict (the per-table section ofmodel_config), not the top-level model config. Renamed to config to matchDataModelTable.config.