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

make models hashable (GSI-482) #2

Merged
merged 33 commits into from
Nov 20, 2023
Merged

Conversation

KerstenBreuer
Copy link
Contributor

- Made models hashable:
  - implemented pydantic-compatible FrozenDict
  - required to get rid of ContentSchema.path and SchemaPack.self_path as it is not possible to exclude properties from hash calculation in pydantic
  - ContentSchema.json_schema is now a string as FrozenDict does not ensure immutability of the values (i.e. if the values are dicts themselves)
- added equality checks
- check that content schemas can be embedded into schemapack definitions

KerstenBreuer and others added 28 commits November 7, 2023 16:26
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
….yaml

Co-authored-by: Christoph Zwerschke <cito@online.de>
…schemapack.yaml

Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Copy link

github-actions bot commented Nov 16, 2023

Pull Request Test Coverage Report for Build 6929890454

  • 37 of 39 (94.87%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.2%) to 94.33%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/schemapack/models.py 15 16 93.75%
src/schemapack/utils.py 21 22 95.45%
Totals Coverage Status
Change from base Build 6888420157: 3.2%
Covered Lines: 183
Relevant Lines: 194

💛 - Coveralls

TheByronHimes
TheByronHimes previously approved these changes Nov 16, 2023
Copy link

@TheByronHimes TheByronHimes left a comment

Choose a reason for hiding this comment

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

FrozenDict looks good

src/schemapack/utils.py Outdated Show resolved Hide resolved
Cito
Cito previously approved these changes Nov 20, 2023
Copy link

@Cito Cito left a comment

Choose a reason for hiding this comment

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

Looks good, made some comments below.

pyproject.toml Outdated Show resolved Hide resolved
tests/test_utils.py Show resolved Hide resolved
src/schemapack/models.py Outdated Show resolved Hide resolved
src/schemapack/models.py Show resolved Hide resolved
src/schemapack/models.py Outdated Show resolved Hide resolved
src/schemapack/utils.py Outdated Show resolved Hide resolved
tests/test_models.py Outdated Show resolved Hide resolved
tests/test_models.py Show resolved Hide resolved
Co-authored-by: Christoph Zwerschke <cito@online.de>
KerstenBreuer and others added 3 commits November 20, 2023 12:56
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <cito@online.de>
@KerstenBreuer KerstenBreuer merged commit 551f263 into main Nov 20, 2023
3 checks passed
@KerstenBreuer KerstenBreuer deleted the feature/make_hashable_GSI-482 branch November 20, 2023 12: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.

3 participants