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

copy_ts() returns non-existent keys #172

Open
khaeru opened this issue Apr 17, 2024 · 1 comment
Open

copy_ts() returns non-existent keys #172

khaeru opened this issue Apr 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working report genno-based reporting and post-solve processing

Comments

@khaeru
Copy link
Member

khaeru commented Apr 17, 2024

@Jihoon discovered that copy_ts() returns Keys like:

[<copy ts -2e5ad320a27116a4:>, <copy ts 1df562ba0f86f8c8:>]

which should, instead, be strings like:

["copy ts -2e5ad320a27116a4", "copy ts 1df562ba0f86f8c8"]

Using the former, invalid keys as inputs to further computations leads to a no-op.

This is likely due to the use of genno.core.key.single_key():

k1 = rep.add("from_url", f"scenario {_id}", quote(other))
k2 = rep.add("get_ts", f"ts data {_id}", k1, filters)
return single_key(rep.add("store_ts", f"copy ts {_id}", "scenario", k2))

Since that's mainly for type checking, we can adjust like:

k_result = f"copy ts {_id}"
rep.add(k_result, "store_ts", "scenario", k2)
return k_result
@khaeru khaeru added the bug Something isn't working label Apr 17, 2024
@Jihoon
Copy link
Contributor

Jihoon commented Apr 18, 2024

This adjustment from @khaeru worked out well.

rep.add(f"scenario {_id}", "from_url", quote(other))
rep.add(f"ts data {_id}", "get_ts", f"scenario {_id}", filters=filters)
result = f"copy ts {_id}"
rep.add(f"copy ts {_id}", "store_ts", "scenario", f"ts data {_id}")
return result

@khaeru khaeru self-assigned this Apr 19, 2024
@khaeru khaeru added the report genno-based reporting and post-solve processing label Apr 19, 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 report genno-based reporting and post-solve processing
Projects
None yet
Development

No branches or pull requests

2 participants