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

Allow identity, ensure dimensions is returned, & use pre-commit.ci #103

Merged
merged 5 commits into from
May 8, 2024

Conversation

CasperWA
Copy link
Collaborator

@CasperWA CasperWA commented Mar 22, 2024

This PR implements 3 things:

  1. Support for aliasing uri as identity in entities.
  2. Ensure dimensions is always returned.
  3. Use pre-commit.ci

Aliasing uri as identity

In the backend, the entities will still use uri. This is similar to the behaviour of dims/shape, where dims is an alias for shape and shape is what is stored in the backend.

This also means when returning the entity from the service uri (and shape) will be used in place of the aliases.

Ensure dimensions is always returned

Always return dimensions from a call to the service. Even if dimensions is an empty list or dict/object.
In the backend, if dimensions is empty, the key will not be stored for the given document/entity.

Use pre-commit.ci

Set up configuration for pre-commit.ci usage in .pre-commit-config.yaml.
It will run pre-commit for each PR as a CI job.
Hence, the current CI job, which runs pre-commit has been "turned off".

@CasperWA CasperWA requested review from quaat and Treesarj March 22, 2024 12:58
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.27%. Comparing base (326de73) to head (8ca76a3).
Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
entities_service/service/utils.py 92.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
+ Coverage   92.26%   92.27%   +0.01%     
==========================================
  Files          26       27       +1     
  Lines        1357     1385      +28     
==========================================
+ Hits         1252     1278      +26     
- Misses        105      107       +2     
Flag Coverage Δ
docker 80.28% <76.66%> (-0.11%) ⬇️
local 91.19% <93.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CasperWA CasperWA changed the title Allow identity key in place of uri Allow identity, ensure dimensions is returned, & use pre-commit.ci Apr 30, 2024
Copy link

@quaat quaat left a comment

Choose a reason for hiding this comment

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

I was thinking we could perhaps consolidate the different existing schemas for entities and make a conversion tool in the soft7 package such that we could "upgrade". That way we don't have to implement any version checking in other tools.

@CasperWA
Copy link
Collaborator Author

CasperWA commented May 8, 2024

I was thinking we could perhaps consolidate the different existing schemas for entities and make a conversion tool in the soft7 package such that we could "upgrade". That way we don't have to implement any version checking in other tools.

I fully agree with this sentiment. Indeed, issue #80 reflects part of this thought.

@CasperWA CasperWA enabled auto-merge (squash) May 8, 2024 11:46
@CasperWA CasperWA merged commit a4c1bb6 into main May 8, 2024
16 checks passed
@CasperWA CasperWA deleted the cwa/allow-identity branch May 8, 2024 11:48
@CasperWA CasperWA added skip_changelog Issues or PRs to be skipped in the CHANGELOG and removed skip_changelog Issues or PRs to be skipped in the CHANGELOG labels Oct 2, 2024
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