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

added has_db_schema_validation flag #364

Closed
wants to merge 2 commits into from
Closed

added has_db_schema_validation flag #364

wants to merge 2 commits into from

Conversation

nh916
Copy link
Contributor

@nh916 nh916 commented Sep 22, 2023

Description

I added a flag to the entire class that can enable or disable the db schema validation

Changes

Tests

Known Issues

Notes

@InnocentBug not sure if we need the flag added to the whole class or if we can just put it on the method instead as a parameter.

I think passing it as an argument is more preferable because it avoids the bulk, and encapsulates everything just in the method.

Checklist

  • My name is on the list of contributors (CONTRIBUTORS.md) in the pull request source branch.
  • I have updated the documentation to reflect my changes.

@trunk-io
Copy link

trunk-io bot commented Sep 22, 2023

Merging to develop in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@nh916 nh916 requested a review from InnocentBug September 22, 2023 00:22
@nh916
Copy link
Contributor Author

nh916 commented Sep 22, 2023

I don't love this implementation because it is either validating everything or nothing, but I think this is just a stepping stone for us to then use it in the next parts of the SDK and allow for turning OFF of some db schema validations and leave the essential ones ON

@@ -603,7 +604,7 @@ def _get_db_schema(self) -> dict:
@beartype
def _is_node_schema_valid(self, node_json: str, is_patch: bool = False) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would write a force_schema_validation argument into this function.
This way, there is a way to force the validation.

And the we can force this validation in api._internal_save.

That looks like the best solution to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@nh916 nh916 requested a review from InnocentBug October 5, 2023 18:41
@InnocentBug InnocentBug deleted the db-schema-flag branch March 27, 2024 13:23
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