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

bug: @load_from and @save_to overwrite tags #1162

Open
zilto opened this issue Oct 2, 2024 · 1 comment
Open

bug: @load_from and @save_to overwrite tags #1162

zilto opened this issue Oct 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@zilto
Copy link
Collaborator

zilto commented Oct 2, 2024

When developing the @cache decorator, which is essentially a custom @tag decorator, I realized that decorator order matters when used with @load_from or @save_to. Instead, we should propagate tags independently of ordering.

For instance, this will apply the hello="world" tag

@load_from.json(path="/path/to/file")
@tag(hello="world")
def foo(data: dict) -> dict:
   return foo

While this will make the tag disappear

@tag(hello="world")
@load_from.json(path="/path/to/file")
def foo(data: dict) -> dict:
   return foo
@zilto zilto added the triage label for issues that need to be triaged. label Oct 2, 2024
@elijahbenizzy
Copy link
Collaborator

This (+ other equivalent) should be changed to propogate tags (I think...). Depends on the way that tag is applied, but yeah, ordering is a bit odd.

@zilto zilto added bug Something isn't working and removed triage label for issues that need to be triaged. labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants