hcloud-python icon indicating copy to clipboard operation
hcloud-python copied to clipboard

Allow disabling magical resource fetching on resource getattr

Open jooola opened this issue 10 months ago • 1 comments

Feature Request

Is your feature request related to a problem? Please describe.

Some users are surprised when resources are automatically fetched if data is missing in their BoundModel.

Describe the solution you'd like

Allow the users to disable this magical feature, so the user can explicitly hydrate the models.

Describe alternatives you've considered

  • Remove the feature altogether, while I think it would make the API client so much easier, this feature has been baked into the library for ages. And many people might be relying on it without knowing it.
  • Provide mitigation, such as a cached session for a scoped context: https://github.com/ansible-collections/hetzner.hcloud/blob/a041bee1b341d8d1a4fee19abf68f97814a2947e/plugins/module_utils/client.py#L70-L108 and https://github.com/ansible-collections/hetzner.hcloud/blob/a041bee1b341d8d1a4fee19abf68f97814a2947e/plugins/inventory/hcloud.py#L473-L474

Teachability, Documentation, Adoption, Migration Strategy

https://chaos.social/@scy/114417503471700303

jooola avatar Apr 29 '25 07:04 jooola

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Jul 28 '25 13:07 github-actions[bot]