Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: drop support field access by attribute. #271

Merged

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Sep 6, 2024

BREAKING CHANGE: removes support for accessing resource fields using
__getattr__ (e.g., user.username). Use __getitem__ instead (e.g.,
user["username"].

depends on #265 and #266
closes #262

Copy link

github-actions bot commented Sep 6, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
985 938 95% 0% 🟢

New Files

File Coverage Status
src/posit/connect/external/external.py 100% 🟢
src/posit/connect/external/snowflake.py 92% 🟢
TOTAL 96% 🟢

Modified Files

File Coverage Status
src/posit/connect/bundles.py 98% 🟢
src/posit/connect/content.py 99% 🟢
src/posit/connect/env.py 100% 🟢
src/posit/connect/external/init.py 100% 🟢
src/posit/connect/external/databricks.py 87% 🟢
src/posit/connect/groups.py 39% 🟢
src/posit/connect/metrics/shiny_usage.py 100% 🟢
src/posit/connect/metrics/visits.py 100% 🟢
src/posit/connect/permissions.py 100% 🟢
src/posit/connect/resources.py 100% 🟢
src/posit/connect/tasks.py 100% 🟢
src/posit/connect/users.py 100% 🟢
src/posit/connect/variants.py 100% 🟢
TOTAL 94% 🟢

updated for commit: 43bb863 by action🐍

@tdstein tdstein changed the title chore! drop support field access by attribute. chore!: drop support field access by attribute. Sep 6, 2024
@tdstein tdstein changed the title chore!: drop support field access by attribute. refactor!: drop support field access by attribute. Sep 6, 2024
@tdstein tdstein marked this pull request as ready for review September 6, 2024 16:22
@tdstein tdstein marked this pull request as draft September 6, 2024 16:22
@tdstein tdstein force-pushed the tdstein/262-remove-deprecated-resource-properties branch from 8b2d080 to 895d996 Compare September 6, 2024 16:53
@tdstein tdstein marked this pull request as ready for review September 6, 2024 16:56
Removes all @Property annotated methods used for direct field access on
concrete resources. A new __getattr__ implementation is added to
Resource to maintain backwards compatiblity. This implementation calls
__getitem__ when the key exists in self. A noisy deprecation warning is
issued to alert users that this functionality will be removed in v1.0.0.
BREAKING CHANGE: removes support for accessing resource fields using
`__getattr__` (e.g., `user.username`). Use `__getitem__` instead (e.g.,
`user["username"]`.
@tdstein tdstein force-pushed the tdstein/262-remove-deprecated-resource-properties branch from 895d996 to 43bb863 Compare September 9, 2024 15:37
Base automatically changed from release/v1.0.0 to main September 9, 2024 17:03
Copy link
Collaborator

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of code deleted! Definitely a worthwhile trade-off. :)

@tdstein tdstein changed the base branch from main to release/v1.0.0 September 10, 2024 01:09
@tdstein tdstein merged commit 894a9e7 into release/v1.0.0 Sep 20, 2024
33 checks passed
@tdstein tdstein deleted the tdstein/262-remove-deprecated-resource-properties branch September 20, 2024 17:51
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.

2 participants