Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Manifest Ingestion DAG
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
Data Flow
Data Ingestion
Manifest Ingestion DAG
Commits
558d0d1e
Commit
558d0d1e
authored
4 years ago
by
Dmitrii Valuiskii (EPAM)
Committed by
Siarhei Khaletski (EPAM)
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GONRG-1721: fix pre-defined ids validation error
parent
cca0b300
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Fix for pre-defined Ids and autogenerated Ids
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/dags/libs/traverse_manifest.py
+3
-1
3 additions, 1 deletion
src/dags/libs/traverse_manifest.py
src/dags/libs/validate_schema.py
+1
-7
1 addition, 7 deletions
src/dags/libs/validate_schema.py
with
4 additions
and
8 deletions
src/dags/libs/traverse_manifest.py
+
3
−
1
View file @
558d0d1e
...
...
@@ -39,8 +39,10 @@ class ManifestTraversal(object):
:param schema: corresponding generic schema (for future schema validation)
:return:
"""
extracted_schema
=
schema
.
split
(
"
/
"
)[
-
1
]
logger
.
debug
(
f
"
Extracted schema kind:
{
extracted_schema
}
"
)
return
{
"
schema
"
:
schema
,
"
schema
"
:
extracted_
schema
,
"
entity
"
:
entity
}
...
...
This diff is collapsed.
Click to expand it.
src/dags/libs/validate_schema.py
+
1
−
7
View file @
558d0d1e
...
...
@@ -158,18 +158,12 @@ class SchemaValidator(HeadersMixin):
raise
e
return
response
def
_delete_id_pattern
(
self
,
schema
:
dict
)
->
dict
:
if
schema
.
get
(
"
properties
"
)
and
schema
[
"
properties
"
].
get
(
"
id
"
):
schema
[
"
properties
"
][
"
id
"
].
pop
(
"
pattern
"
,
None
)
return
schema
def
_validate_entity
(
self
,
entity
:
dict
,
schema
:
dict
=
None
):
"""
Validate the
'
data
'
field of any entity against a schema got by entity
'
s kind.
"""
if
not
schema
:
schema
=
self
.
get_schema
(
entity
[
"
kind
"
])
schema
=
self
.
_delete_id_pattern
(
schema
)
data
=
entity
[
"
data
"
]
try
:
self
.
_validate_against_schema
(
schema
,
data
)
...
...
@@ -258,7 +252,7 @@ class SchemaValidator(HeadersMixin):
return
True
except
exceptions
.
ValidationError
as
exc
:
logger
.
error
(
"
Schema validation error.
"
)
logger
.
error
(
f
"
Manifest kind:
{
schema
[
'
kind
'
]
}
"
)
logger
.
error
(
f
"
Manifest kind:
{
entity
[
'
kind
'
]
}
"
)
logger
.
error
(
f
"
Manifest:
{
entity
}
"
)
logger
.
error
(
f
"
Error:
{
exc
}
"
)
return
False
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment