Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmendsenProject
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shaik Janipasha
AmendsenProject
Commits
776f8840
Unverified
Commit
776f8840
authored
Feb 28, 2019
by
Jin Hyuk Chang
Committed by
GitHub
Feb 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using ConfigTree.with_fallback method in job level
parent
caaea071
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
18 deletions
+20
-18
job.py
databuilder/job/job.py
+1
-2
neo4j_staleness_removal_task.py
databuilder/task/neo4j_staleness_removal_task.py
+5
-2
setup.py
setup.py
+1
-1
test_neo4j_staleness_removal_task.py
tests/unit/task/test_neo4j_staleness_removal_task.py
+13
-13
No files found.
databuilder/job/job.py
View file @
776f8840
...
...
@@ -48,8 +48,7 @@ class DefaultJob(Job):
def
_init
(
self
):
# type: () -> None
task_conf
=
Scoped
.
get_scoped_conf
(
self
.
conf
,
self
.
task
.
get_scope
())
self
.
task
.
init
(
task_conf
.
with_fallback
(
self
.
conf
))
self
.
task
.
init
(
self
.
conf
)
def
launch
(
self
):
# type: () -> None
...
...
databuilder/task/neo4j_staleness_removal_task.py
View file @
776f8840
...
...
@@ -6,9 +6,11 @@ from pyhocon import ConfigFactory # noqa: F401
from
pyhocon
import
ConfigTree
# noqa: F401
from
typing
import
Dict
,
Iterable
,
Any
# noqa: F401
from
databuilder
import
Scoped
from
databuilder.task.base_task
import
Task
# noqa: F401
from
databuilder.publisher.neo4j_csv_publisher
import
JOB_PUBLISH_TAG
# A end point for Neo4j e.g: bolt://localhost:9999
NEO4J_END_POINT_KEY
=
'neo4j_endpoint'
NEO4J_MAX_CONN_LIFE_TIME_SEC
=
'neo4j_max_conn_life_time_sec'
...
...
@@ -53,8 +55,9 @@ class Neo4jStalenessRemovalTask(Task):
def
init
(
self
,
conf
):
# type: (ConfigTree) -> None
conf
=
conf
.
with_fallback
(
DEFAULT_CONFIG
)
conf
=
Scoped
.
get_scoped_conf
(
conf
,
self
.
get_scope
())
\
.
with_fallback
(
conf
)
\
.
with_fallback
(
DEFAULT_CONFIG
)
self
.
target_nodes
=
set
(
conf
.
get_list
(
TARGET_NODES
))
self
.
target_relations
=
set
(
conf
.
get_list
(
TARGET_RELATIONS
))
self
.
batch_size
=
conf
.
get_int
(
BATCH_SIZE
)
...
...
setup.py
View file @
776f8840
from
setuptools
import
setup
,
find_packages
__version__
=
'1.0.
3
'
__version__
=
'1.0.
4
'
setup
(
name
=
'amundsen-databuilder'
,
...
...
tests/unit/task/test_neo4j_staleness_removal_task.py
View file @
776f8840
...
...
@@ -23,13 +23,13 @@ class TestRemoveStaleData(unittest.TestCase):
task
=
Neo4jStalenessRemovalTask
()
job_config
=
ConfigFactory
.
from_dict
({
'job.identifier'
:
'remove_stale_data_job'
,
neo4j_staleness_removal_task
.
NEO4J_END_POINT_KEY
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_END_POINT_KEY
)
:
'foobar'
,
neo4j_staleness_removal_task
.
NEO4J_USER
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_USER
)
:
'foo'
,
neo4j_staleness_removal_task
.
NEO4J_PASSWORD
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_PASSWORD
)
:
'bar'
,
neo4j_staleness_removal_task
.
STALENESS_MAX_PCT
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
STALENESS_MAX_PCT
)
:
90
,
neo4j_csv_publisher
.
JOB_PUBLISH_TAG
:
'foo'
})
...
...
@@ -47,13 +47,13 @@ class TestRemoveStaleData(unittest.TestCase):
task
=
Neo4jStalenessRemovalTask
()
job_config
=
ConfigFactory
.
from_dict
({
'job.identifier'
:
'remove_stale_data_job'
,
neo4j_staleness_removal_task
.
NEO4J_END_POINT_KEY
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_END_POINT_KEY
)
:
'foobar'
,
neo4j_staleness_removal_task
.
NEO4J_USER
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_USER
)
:
'foo'
,
neo4j_staleness_removal_task
.
NEO4J_PASSWORD
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_PASSWORD
)
:
'bar'
,
neo4j_staleness_removal_task
.
STALENESS_MAX_PCT
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
STALENESS_MAX_PCT
)
:
5
,
neo4j_csv_publisher
.
JOB_PUBLISH_TAG
:
'foo'
})
...
...
@@ -71,15 +71,15 @@ class TestRemoveStaleData(unittest.TestCase):
task
=
Neo4jStalenessRemovalTask
()
job_config
=
ConfigFactory
.
from_dict
({
'job.identifier'
:
'remove_stale_data_job'
,
neo4j_staleness_removal_task
.
NEO4J_END_POINT_KEY
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_END_POINT_KEY
)
:
'foobar'
,
neo4j_staleness_removal_task
.
NEO4J_USER
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_USER
)
:
'foo'
,
neo4j_staleness_removal_task
.
NEO4J_PASSWORD
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
NEO4J_PASSWORD
)
:
'bar'
,
neo4j_staleness_removal_task
.
STALENESS_MAX_PCT
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
STALENESS_MAX_PCT
)
:
5
,
neo4j_staleness_removal_task
.
STALENESS_PCT_MAX_DICT
:
'{}.{}'
.
format
(
task
.
get_scope
(),
neo4j_staleness_removal_task
.
STALENESS_PCT_MAX_DICT
)
:
{
'foo'
:
51
},
neo4j_csv_publisher
.
JOB_PUBLISH_TAG
:
'foo'
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment