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

DM-45938: Add support for generating IDs on data model objects #100

Merged
merged 8 commits into from
Aug 29, 2024

Conversation

JeremyMcCormick
Copy link
Collaborator

@JeremyMcCormick JeremyMcCormick commented Aug 23, 2024

Add an --id-generation flag which turns on generation of @id values for schema objects that do not have them.

Add a Schema validator that checks if index names are unique.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 89.15663% with 9 lines in your changes missing coverage. Please review.

Project coverage is 90.92%. Comparing base (f1346db) to head (0da628c).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
python/felis/datamodel.py 80.00% 0 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
+ Coverage   90.74%   90.92%   +0.18%     
==========================================
  Files          16       16              
  Lines        1805     1885      +80     
  Branches      386      417      +31     
==========================================
+ Hits         1638     1714      +76     
+ Misses        101       97       -4     
- Partials       66       74       +8     

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

@JeremyMcCormick JeremyMcCormick force-pushed the tickets/DM-45938 branch 6 times, most recently from e7285e1 to 22c03e3 Compare August 26, 2024 23:45
docs/changes/DM-45938.feature.rst Show resolved Hide resolved
python/felis/datamodel.py Show resolved Hide resolved
Implement a pre-validator which creates object IDs where they are
missing on Schema objects.

The values of the generated IDs for schema, table and column objects
are constructed based on the common usage patterns from SDM Schemas.

Constraints and indexes use the name field as the ID.

The `--id-generation` flag must be used from the command-line to enable
this feature, as it is off by default.
Add a top-level flag for enabling ID generation and pass it to the
other commands via the Click context.
Load a schema without IDs and set them, and load the same schema with
ID generation turned off to check that an exception is thrown.
Copy link

@gpdf gpdf 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 now. Very much agree with the goal of removing the requirement to tediously supply IDs in the input schema files.

@JeremyMcCormick JeremyMcCormick merged commit 364fc5c into main Aug 29, 2024
14 of 15 checks passed
@JeremyMcCormick JeremyMcCormick deleted the tickets/DM-45938 branch August 29, 2024 01:29
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