Skip to content

fix: guard YAMLConfig.keys() against non-dict YAML content#84

Merged
Jammy2211 merged 1 commit intomainfrom
feature/fix-yaml-list-config
Apr 8, 2026
Merged

fix: guard YAMLConfig.keys() against non-dict YAML content#84
Jammy2211 merged 1 commit intomainfrom
feature/fix-yaml-list-config

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

YAML files with list content at the top level (e.g. no_run.yaml) caused AttributeError: 'list' object has no attribute 'keys' when the config system iterated their keys during startup. This broke all workspace script imports. Added a type guard in YAMLConfig.keys() to return empty keys for non-dict YAML files.

API Changes

None — internal changes only.

Test Plan

  • All 71 PyAutoConf unit tests pass
  • import autofit as af; import autolens as al succeeds in autolens_workspace
  • Workspace smoke tests
Full API Changes (for automation & release notes)

No public API changes. Internal defensive fix only.

🤖 Generated with Claude Code

YAML files with list content (e.g. no_run.yaml) caused an AttributeError
when the config system tried to iterate their keys during startup, breaking
all workspace script imports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 2dc48be into main Apr 8, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/fix-yaml-list-config branch April 8, 2026 08:58
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