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

Add schema and config validation to jsonschema package #740

Merged
merged 15 commits into from
Sep 7, 2023

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Sep 6, 2023

Changes

At a high level this PR adds new schema validation and moves functionality that should be present in the jsonschema package, but resides in the template package today, to the jsonschema package. This includes for example schema validation, schema instance validation, to / from string conversion methods etc.

The list below outlines all the pieces that have been moved over, and the new validation bits added.

This PR:

  1. Adds casting default value of schema properties to integers to the jsonschema.Load method.
  2. Adds validation for default value types for schema properties, checking they are consistant with the type defined.
  3. Introduces the LoadInstance and ValidateInstance methods to the json schema package. These methods can be used to read and validate JSON documents against the schema.
  4. Replaces validation done for template inputs to use the newly defined JSON schema validation functions.
  5. Moves to/from string and isInteger utility methods to the json schema package.

Tests

Existing and new unit tests.

@shreyas-goenka shreyas-goenka changed the title [WIP] Add schema and config validation to jsonschema package Add schema and config validation to jsonschema package Sep 7, 2023
@shreyas-goenka
Copy link
Contributor Author

note: added a unit test for LoadInstance , the PR is ready for review.

libs/jsonschema/instance.go Outdated Show resolved Hide resolved
libs/jsonschema/instance.go Outdated Show resolved Hide resolved
libs/jsonschema/instance.go Show resolved Hide resolved
libs/jsonschema/schema.go Outdated Show resolved Hide resolved
libs/jsonschema/schema.go Outdated Show resolved Hide resolved
libs/jsonschema/instance.go Show resolved Hide resolved
libs/template/config.go Outdated Show resolved Hide resolved
@shreyas-goenka shreyas-goenka added this pull request to the merge queue Sep 7, 2023
Merged via the queue into main with commit 1a7bf4e Sep 7, 2023
4 checks passed
@shreyas-goenka shreyas-goenka deleted the schema-config-validators branch September 7, 2023 14:43
arpitjasa-db pushed a commit to arpitjasa-db/cli that referenced this pull request Sep 7, 2023
## Changes

At a high level this PR adds new schema validation and moves
functionality that should be present in the jsonschema package, but
resides in the template package today, to the jsonschema package. This
includes for example schema validation, schema instance validation, to /
from string conversion methods etc.

The list below outlines all the pieces that have been moved over, and
the new validation bits added.

This PR:
1. Adds casting default value of schema properties to integers to the
jsonschema.Load method.
2. Adds validation for default value types for schema properties,
checking they are consistant with the type defined.
3. Introduces the LoadInstance and ValidateInstance methods to the json
schema package. These methods can be used to read and validate JSON
documents against the schema.
4. Replaces validation done for template inputs to use the newly defined
JSON schema validation functions.
5. Moves to/from string and isInteger utility methods to the json schema
package.

## Tests
Existing and new unit tests.

Signed-off-by: Arpit Jasapara <arpit.jasapara@databricks.com>
pietern added a commit that referenced this pull request Sep 11, 2023
Bundles:
 * Fix conversion of job parameters ([#744](#744)).
 * Add schema and config validation to jsonschema package ([#740](#740)).
 * Support Model Serving Endpoints in bundles ([#682](#682)).
 * Do not include empty output in job run output ([#749](#749)).
 * Fixed marking libraries from DBFS as remote ([#750](#750)).
 * Process only Python wheel tasks which have local libraries used ([#751](#751)).
 * Add enum support for bundle templates ([#668](#668)).
 * Apply Python wheel trampoline if workspace library is used ([#755](#755)).
 * List available targets when incorrect target passed ([#756](#756)).
 * Make bundle and sync fields optional ([#757](#757)).
 * Consolidate environment variable interaction ([#747](#747)).

Internal:
 * Update Go SDK to v0.19.1 ([#759](#759)).
@pietern pietern mentioned this pull request Sep 11, 2023
github-merge-queue bot pushed a commit that referenced this pull request Sep 11, 2023
Bundles:
* Fix conversion of job parameters
([#744](#744)).
* Add schema and config validation to jsonschema package
([#740](#740)).
* Support Model Serving Endpoints in bundles
([#682](#682)).
* Do not include empty output in job run output
([#749](#749)).
* Fixed marking libraries from DBFS as remote
([#750](#750)).
* Process only Python wheel tasks which have local libraries used
([#751](#751)).
* Add enum support for bundle templates
([#668](#668)).
* Apply Python wheel trampoline if workspace library is used
([#755](#755)).
* List available targets when incorrect target passed
([#756](#756)).
* Make bundle and sync fields optional
([#757](#757)).
* Consolidate environment variable interaction
([#747](#747)).

Internal:
* Update Go SDK to v0.19.1
([#759](#759)).
hectorcast-db pushed a commit that referenced this pull request Oct 13, 2023
Bundles:
* Fix conversion of job parameters
([#744](#744)).
* Add schema and config validation to jsonschema package
([#740](#740)).
* Support Model Serving Endpoints in bundles
([#682](#682)).
* Do not include empty output in job run output
([#749](#749)).
* Fixed marking libraries from DBFS as remote
([#750](#750)).
* Process only Python wheel tasks which have local libraries used
([#751](#751)).
* Add enum support for bundle templates
([#668](#668)).
* Apply Python wheel trampoline if workspace library is used
([#755](#755)).
* List available targets when incorrect target passed
([#756](#756)).
* Make bundle and sync fields optional
([#757](#757)).
* Consolidate environment variable interaction
([#747](#747)).

Internal:
* Update Go SDK to v0.19.1
([#759](#759)).
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