Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Creating multiple accepted name data wranglers can overwrite each other #339

Open
cjgrady opened this issue May 26, 2022 · 0 comments
Open
Assignees
Labels
bug Something isn't working data_wrangler Tasks related to data wranglers tools Tasks related to lmpy tools
Milestone

Comments

@cjgrady
Copy link
Contributor

cjgrady commented May 26, 2022

If you create multiple accepted name data wranglers, for example, when aggregating occurrence data from multiple sources, that use the same name resolution service, they do not share a cache of data and the last one to write will overwrite the names file.

This happens because they are initialized at the same time and do not share a cache.

This could be solved in multiple ways.

  1. Create one instance of the accepted name data wrangler and reuse it. This method would not work with factory configurations
  2. Only have one instance at a time by closing (deleting via garbage collecting) before creating a new instance. This would work with factory configurations
  3. Make the underlying accepted name wrangler base a singleton class. This would allow anyone writing their own code to not worry about, or even be aware, of the issue.

I think the singleton option may be the best but there may be other options or benefits to something else.

@cjgrady cjgrady added the bug Something isn't working label May 26, 2022
@cjgrady cjgrady self-assigned this May 26, 2022
@cjgrady cjgrady added this to the Version-3.2 milestone May 26, 2022
@cjgrady cjgrady added tools Tasks related to lmpy tools data_wrangler Tasks related to data wranglers labels May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working data_wrangler Tasks related to data wranglers tools Tasks related to lmpy tools
Projects
None yet
Development

No branches or pull requests

1 participant