Skip to content

fix: four API-level bug fixes#69

Closed
martinv13 wants to merge 2 commits into
cre-dev:mainfrom
martinv13:fix/minor-api-corrections
Closed

fix: four API-level bug fixes#69
martinv13 wants to merge 2 commits into
cre-dev:mainfrom
martinv13:fix/minor-api-corrections

Conversation

@martinv13

Copy link
Copy Markdown
Collaborator

Fixes four bugs identified during a documentation audit.

  • DataModel table-name validation was silently dead. _build_model iterated over self.model_config.get("tables", {}), but _validate_config strips the "tables" key from self.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_config instead.
  • XMLConverter.parse_xml skip_validation default was inverted. The low-level method defaulted to False (validate), while Document.parse_xml and DataModel.parse_xml both default to True (skip), matching the documented
    behaviour. Anyone calling XMLConverter.parse_xml directly without the keyword argument got silent validation. Aligned to True.
  • DatabaseDialect.db_identifier carried a dead temp_prefix parameter. 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 14
    characters for the prefix"). Removed.
  • DataModelColumn.model_config was a misnomer. The attribute stores the table-level config dict (the per-table section of model_config), not the top-level model config. Renamed to config to match
    DataModelTable.config.

martinv13 and others added 2 commits June 22, 2026 10:05
- 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>
@martinv13 martinv13 closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant