Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Workers
Base Worker
Merge requests
!93
Retrieve ARKINDEX_CORPUS_ID in create_entity when corpus is None
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Retrieve ARKINDEX_CORPUS_ID in create_entity when corpus is None
corpus-create-entity
into
master
Overview
3
Commits
2
Pipelines
1
Changes
2
All threads resolved!
Show all comments
Merged
Eva Bardou
requested to merge
corpus-create-entity
into
master
3 years ago
Overview
3
Commits
2
Pipelines
1
Changes
2
All threads resolved!
Show all comments
Expand
Closes
#61 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
e5b1f250
2 commits,
3 years ago
2 files
+
21
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
arkindex_worker/worker/entity.py
+
7
−
3
Options
# -*- coding: utf-8 -*-
import
os
from
enum
import
Enum
from
arkindex_worker
import
logger
@@ -19,11 +18,16 @@ class EntityType(Enum):
class
EntityMixin
(
object
):
def
create_entity
(
self
,
element
,
name
,
type
,
corpus
,
metas
=
None
,
validated
=
None
):
def
create_entity
(
self
,
element
,
name
,
type
,
corpus
=
None
,
metas
=
None
,
validated
=
None
):
"""
Create an entity on the given corpus through API
Return the ID of the created entity
"""
if
corpus
is
None
:
corpus
=
os
.
environ
.
get
(
"
ARKINDEX_CORPUS_ID
"
)
assert
element
and
isinstance
(
element
,
(
Element
,
CachedElement
)
),
"
element shouldn
'
t be null and should be an Element or CachedElement
"
Loading