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

constants.py should not invoke schemaview #322

Closed
cmungall opened this issue Oct 21, 2022 · 2 comments · Fixed by #324
Closed

constants.py should not invoke schemaview #322

cmungall opened this issue Oct 21, 2022 · 2 comments · Fixed by #324
Assignees

Comments

@cmungall
Copy link
Collaborator

This is called *when importing sssom-py:

HERE = pathlib.Path(__file__).parent.resolve()
SCHEMA_YAML = pkg_resources.resource_filename(
"sssom_schema", "schema/sssom_schema.yaml"
)
SCHEMA_VIEW = SchemaView(SCHEMA_YAML)

in general it's not a good idea to have logic executed when a package is imported. logic should only be done on specific invocation of that logic.

in this case it's particularly problematic as this invokes a network call...

@matentzn
Copy link
Collaborator

@hrshdhgd - can you remind me why a "network call" is required here?

@hrshdhgd
Copy link
Contributor

hrshdhgd commented Oct 25, 2022

I'm guessing the network call has to do with pkg_resources that calls the schema from sssom_schema. I do not fully understand this request. I was going to ask @cmungall for some clarification during our one-on-one but since you're not clear about it either, Chris could you please enlighten us both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants