Skip to content

Update dummyVariable naming schema across branches #172

@DougManuel

Description

@DougManuel

Summary

The dummyVariable naming convention in metadata_registry.yaml and variable_details.yaml has been updated on the diet-score branch to match actual practice. The old schema allowed patterns that are no longer correct.

Changes made (diet-score branch)

inst/metadata/documentation/metadata_registry.yaml:

  • Old regex: ^[a-zA-Z0-9_]+_(cat|cont)[0-9]+(_[0-9]+|_NA::[a-z])?$
  • New categorical regex: ^[a-zA-Z0-9_]+_cat[0-9]+(_[0-9]+|_NA[a-z])$
  • Continuous/Func rows: N/A
  • Added missing_categories examples (_NAa, _NAb)
  • Removed _cont{N} examples (not used in practice)

inst/metadata/schemas/core/variable_details.yaml:

  • Updated dummyVariable notes to match new convention
  • Removed _cont{N} examples
  • Added _NAa/_NAb examples

What changed

  1. No colons_NAa and _NAb instead of _NA::a and _NA::b
  2. No _cont pattern — continuous variables use N/A
  3. Func rows use N/A — not a constructed name

Propagation needed

These schema files exist on multiple branches under review. The updated schema needs to be propagated to:

  • v3-smoking (smoking harmonization)
  • main (after current PRs merge)
  • Any other active feature branches

The cchsflow-review SKILL.md (Check 5b) enforces the correct convention regardless of which schema version is on the branch, so this is not blocking reviews.

Related

  • PR diet score #148 (diet variables) — where the discrepancy was discovered
  • cchsflow-review SKILL.md Check 5b documents the convention

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions