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

Disable MetadataComponent for local development #216

Open
janheinrichmerker opened this issue Nov 25, 2022 · 0 comments
Open

Disable MetadataComponent for local development #216

janheinrichmerker opened this issue Nov 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@janheinrichmerker
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The MetadataComponent, as I understand it, speeds up querying metadata in production by having a pre-computed metadata index.
But when developing doc classes for new datasets, this component often intercepts calls to docs_count etc, making it difficult to trace down issues in the development code (because the MetadataComponent sort of monkey-patches the corresponding functions).

Describe the solution you'd like
I'd be happy to have some opt-out environment variable to effectively switch off the monkey patching in this line:

if not hasattr(obj, 'metadata'):
obj = Dataset(MetadataComponent(name, obj), obj) # add metadata from default provider

Describe alternatives you've considered
Alternatively, the metadata component should at least have clear error messages that tell developers that some metadata is missing and how to add those.

Additional context
For developing integrations for large datasets, e.g., #213, having to generate metadata while developing the parsers is also not that great as one would often test the parsers on a smaller sample before computing metadata on the whole database.

@janheinrichmerker janheinrichmerker added the enhancement New feature or request label Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant