Skip to content

Conversation

@andrewelamb
Copy link
Contributor

@andrewelamb andrewelamb commented Jan 13, 2026

SYNPY-1744

Problem:

When the Curator Extension functions are called, but the specific packages haven't been installed, the error messaging was more or less useful depending on the package. For example, if only the inflection package is missing the camelize function wouldn't be available, and things would break with a very unhelpful exception to users.

Solution:

A function was added that checks that all Curator Extension packages are importable. This is called by generate_json_schema and generate_jsonld. If this function can't import all packages, a helpful message is part of an ImportException that is raised, telling the user how to install the Curator packages.

In addition, the jsonschema package is only used for testing, so it was moved from the curator section to the tests section in setup.cfg.

@andrewelamb andrewelamb requested a review from a team as a code owner January 13, 2026 20:32
Copy link
Member

@BryanFauble BryanFauble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this to make this clearer what the users should be doing! I tested this out and can verify I got the ImportError:

ImportError: One or more packages needed for the Curator extension are not installed.Please install using 'pip install --upgrade 'synapseclient[curator]'

func-timeout~=4.3
pytest-cov~=4.1.0
pandas>=1.5,<3.0
jsonschema>=4.23.0
Copy link
Member

@thomasyu888 thomasyu888 Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this move? Does curator not need this package anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it was never in the Curator extension code. It is part of the tests for Curator extension.



def check_curator_imports() -> None:
"""Attempts to import all necessary packages for the Curator extension.
Copy link
Member

@thomasyu888 thomasyu888 Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To discuss: Should this be in core.utils?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be. It is only used here in this file though, and I doubt it will be used elswhere.

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 thanks for the quick work and review!

@andrewelamb andrewelamb merged commit c1ff3a2 into develop Jan 14, 2026
25 of 28 checks passed
@andrewelamb andrewelamb deleted the SYNPY-1744 branch January 14, 2026 15:09
@andrewelamb andrewelamb restored the SYNPY-1744 branch January 14, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants