Typing: VirtualMachine optional fields
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 763
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Type hints for the VirtualMachine object aren't correct. The following fields should be optional (according to the documentation):
- config
- datastore
- guest
- layout
- layoutEx
- network
- parentVApp
- resourceConfig
- resourcePool
- rootSnapshot
- snapshot
- storage
Reproduction steps
Look at VirtualMachine object type hints.
vm: vim.VirtualMachine
... (logic for fetching VM)
config: vim.vm.ConfigInfo | None = vm.config (<- is not 100% correct, because vm.config type hint is just vim.vm.ConfigInfo)
Expected behavior
Type hints are shown as optional for those fields.
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the VirtualMachine object type hints and compare the listed fields with the linked vSphere documentation. Update the annotations so config, datastore, guest, layout, layoutEx, network, parentVApp, resourceConfig, resourcePool, rootSnapshot, snapshot, and storage are optional, then verify the reproduced type-checking example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100