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

feature/mx-1649 add preview models and api method #347

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

cutoffthetop
Copy link
Contributor

@cutoffthetop cutoffthetop commented Dec 5, 2024

PR Context

  • prep for feature/mx-1649 prevent and subtract mex-editor#192
  • preview models don't care about required fields and length limits for lists
  • they will be used by the editor to be able to search even for potentially "broken" items
  • also includes some clean-up of the mex.common.models module (imports, exports and docs)

Added

  • add preview models for merged items without cardinality validation
  • BREAKING: preview models are now part of all mex.common.fields lookups
  • add BackendApiConnector.fetch_preview_items for fetching previews

Deprecated

  • stop using ExtractedData, use AnyExtractedModel instead
  • stop using MergedItem, use AnyMergedModel instead
  • stop using AdditiveRule, use AnyAdditiveRule instead
  • stop using SubtractiveRule, use AnySubtractiveRule instead
  • stop using PreventiveRule, use AnyPreventiveRule instead
  • stop using BaseEntity, use a concrete union instead

Removed

  • removed deprecated BulkInsertResponse as alias for IdentifiersResponse
  • removed unused module export of mex.common.models.generate_entity_filter_schema
  • removed unused module export of mex.common.models.generate_mapping_schema
  • drop export models.ExtractedPrimarySourceIdentifier, import from types instead
  • drop export models.MergedPrimarySourceIdentifier, import from types instead

Copy link
Contributor

@rababerladuseladim rababerladuseladim left a comment

Choose a reason for hiding this comment

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

Nice, only missing a test for the BackendConnector.fetch_preview_items method. Could you add one?

mex/common/models/base/merged_item.py Outdated Show resolved Hide resolved
@cutoffthetop
Copy link
Contributor Author

Nice, only missing a test for the BackendConnector.fetch_preview_items method. Could you add one?

done in 37baf24

@cutoffthetop cutoffthetop merged commit 04aea46 into main Dec 10, 2024
4 checks passed
@cutoffthetop cutoffthetop deleted the feature/mx-1649-add-preview-models branch December 10, 2024 12:47
cutoffthetop added a commit to robert-koch-institut/mex-backend that referenced this pull request Dec 10, 2024
# PR Context
- needs robert-koch-institut/mex-common#347
- prep for robert-koch-institut/mex-editor#192

# Added
- allow item merging functions to ignore cardinality and output preview
items

# Changes
- create new endpoint for fetching previews of merged items
- replaced `mex.backend.fields` with `mex.common` counterpart

# Removed
- removed over-engineered `reraising` function
cutoffthetop added a commit to robert-koch-institut/mex-extractors that referenced this pull request Dec 11, 2024
### PR Context

- upgrade to robert-koch-institut/mex-common#347
- move away from "extracted data" naming, and over to "extracted items"
(for consistency)

### Changes

- BREAKING: rename artificial provider function `extracted_data` to
`extracted_items`
- prefer concrete unions over base classes for merged and extracted item
typing
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.

2 participants