ensures default views are owned by group, so anyone can drop/replace them#240
ensures default views are owned by group, so anyone can drop/replace them#240tomjemmett wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the default view-creation scripts to ensure the created/replaced views are reassigned to a shared owning group (so group members can manage/drop/replace them consistently).
Changes:
- Update
create(...)to accept anobject_owner_groupand runALTER VIEW ... OWNER TO ...after view creation. - Update CLIs (
main()) to useget_spark()and fetchobject_owner_groupfrom Databricks secrets viaDBUtils. - Fix/correct
main()docstrings for the affected default view scripts.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/nhp/data/default/apc.py |
Adds ownership reassignment for both APC views; main() now pulls group from secrets and uses get_spark(). |
src/nhp/data/default/ecds.py |
Adds ownership reassignment for the ECDS view; main() now pulls group from secrets and uses get_spark(). |
src/nhp/data/default/opa.py |
Adds ownership reassignment for the OPA view; main() now pulls group from secrets and uses get_spark(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot can you re-review and check that prior noted issues are handled now? I've added some steps to prevent sql injection |
…sible Agent-Logs-Url: https://github.com/The-Strategy-Unit/nhp_data/sessions/139a104b-c9be-4244-995e-c93563ed2e7a Co-authored-by: tomjemmett <12023696+tomjemmett@users.noreply.github.com>
Re-reviewed the changes. Here's the status of the prior noted issues: SQL injection (comments on apc.py:34-39, 41-46, ecds.py:25-30, opa.py:25-30): ✅ Addressed by the Missing secret error handling (comment on apc.py:13): was still unhandled. Fixed in fee7080 — added a |
was converting a multi-part object name like a.b.c into `a.b.c`, rather than `a`.`b`.`c`. I think it's fine to just leave the identifier as is, other than the small amount of validation to ensure it is a valid identifier
|
closing this, approach doesn't work as the views when owned by the group can't read the data |
No description provided.