Skip to content

feat(serverdb): Allow to redirect attributes via alias - #472

Open
kofrezo wants to merge 3 commits into
mainfrom
dk_attribute_redirects
Open

kofrezo wants to merge 3 commits into
mainfrom
dk_attribute_redirects

Conversation

@kofrezo

@kofrezo kofrezo commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

To ease renaming attributes this feature allows to set up an alias for an attribute so that requests still using the old name continue working and allow a graceful migration.

Do not resolve redirect in the Servershell as humans should pick up the new name immediately otherwise it could increase the risk to become a permanent thing because we humans are lazy

To ease renaming attributes this feature allows to set up an alias for
an attribute so that requests still using the old name continue working
and allow a graceful migration.

Do not resolve redirect in the Servershell as humans should pick up the
new name immediately otherwise it could increase the risk to become a
permanent thing because we humans are lazy
@kofrezo
kofrezo requested a review from Phantuman September 25, 2026 14:53
@kofrezo kofrezo self-assigned this Sep 25, 2026
@kofrezo
kofrezo requested a review from brainexe September 28, 2026 07:45
Comment thread packages/serveradmin/serveradmin/serverdb/admin.py Outdated
@brainexe

Copy link
Copy Markdown
Member

One issue while testing: related fields, like adminapi "project=admin" -a project.short_code' fails now, even without any alias:

web-1  | TypeError: unhashable type: 'dict'
web-1  | Internal Server Error: /api/dataset/query
web-1  |   File "/code/packages/serveradmin/serveradmin/api/views.py", line 72, in dataset_query
web-1  |     filters, restrict, order_by = AttributeRedirect.resolve_aliases(filters, restrict, order_by)
web-1  |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forgot about the joined queries. Added a test with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants