-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add envidat data connectors support #1119
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
base: main
Are you sure you want to change the base?
Conversation
|
You can access the deployment of this PR at https://renku-ci-ds-1119.dev.renku.ch |
7302f39 to
43d6a9b
Compare
leafty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is an "initial support", should it be merged to a feature branch instead?
|
Sorry I meant to convert this to draft right away. But I forgot. Sorry @eikek |
components/renku_data_services/data_connectors/doi/schema_org.py
Outdated
Show resolved
Hide resolved
a8217cd to
8b2a0d0
Compare
abd7384 to
5deac52
Compare
50a5d8a to
d10793b
Compare
afc6c61 to
dc0802d
Compare
dc0802d to
b2adaf7
Compare
|
If you want to test this:
|
eikek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
| match provider: | ||
| case DatasetProvider.envidat: | ||
| return __get_rclone_s3_config_envidat(dataset) | ||
| # TODO: Add scicat here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this left on purpose?
| with contextlib.suppress(errors.ValidationError): | ||
| name_slug = base_models.Slug.from_name(name).value | ||
| target_path = base_models.Slug.from_name(f"{name_slug[:30]}-{target_path}").value | ||
| if metadata: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I overlook something: the check for metadata seems unecessary, that symbol is not used in the body? did you maybe mean if not metadata?
| new_config = payload.model_copy(deep=True) | ||
| new_config.configuration = {} | ||
|
|
||
| envidat_url = "https://envidat.ch/converters-api/internal-dataset/convert/jsonld" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This occurs at another place, could it be useful to have a constant/central places for it?
|
|
||
| @classmethod | ||
| def doi_is(cls, doi: str, *args: str) -> Segment: | ||
| """Return slug-is query segment.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is revealing the copy source :-) (below the same)
| @classmethod | ||
| def from_dict(cls, d: dict[str, Any]) -> DataConnector: | ||
| """Create a Project from a dictionary.""" | ||
| """Create a data connector from a dictionary.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙏🏼
| """Process slug-is segment.""" | ||
| self.__append(st.field_is_any(Fields.slug, ft.values.map(st.from_str))) | ||
|
|
||
| async def visit_doi_is(self, ft: DoiIs) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some unit tests - perhaps they could be amended by a few cases now. The test_field_term() in test_user_query_parser could be such a place.
Then there is also a manual that gets included in the api spec description. New fields are automatically listed. You can view it by running test_query_manual.py manually opening the created manual.html. I guess for these two fields, nothing needs to be done, though.
/deploy renku-ui=olevski/feat-modify-global-dc-display
Initial support for envidat datasets.
The following changes are made: