-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SHARE-993][Feature] Capture ingest errors (#732)
* Use custom exceptions for transform errors * Allow running sharectl transform on RawDatums * Update exception expections. * Move disambiguate task into IngestJobConsumer * More friendly display of things * Some cleanup * Fix up push endpoints * Consolidate migrations * Add Ingester util * Update management commands * Allow claiming jobs when explicitly starting tasks * Update migration * Plac8 flake8 * Better migration * Fix tests * Responding to review * Fix more tests
- Loading branch information
Showing
69 changed files
with
1,071 additions
and
710 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from rest_framework_json_api import serializers | ||
|
||
from share import models | ||
|
||
from api.base import ShareSerializer | ||
from api.fields import ShareIdentityField | ||
|
||
|
||
class IngestJobSerializer(ShareSerializer): | ||
# link to self | ||
url = ShareIdentityField(view_name='api:ingestjob-detail') | ||
|
||
status = serializers.SerializerMethodField() | ||
|
||
class Meta: | ||
model = models.IngestJob | ||
fields = ( | ||
'status', | ||
'message', | ||
'completions', | ||
'date_started', | ||
'date_created', | ||
'date_modified', | ||
'raw', | ||
'source_config', | ||
'url' | ||
) | ||
|
||
def get_status(self, job): | ||
return job.STATUS[job.status] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from rest_framework.routers import SimpleRouter | ||
from api.ingestjobs import views | ||
|
||
|
||
router = SimpleRouter() | ||
router.register(r'ingestjobs', views.IngestJobViewSet, base_name='ingestjob') | ||
urlpatterns = router.urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from rest_framework import viewsets | ||
|
||
from share.models.jobs import IngestJob | ||
|
||
from api.base.views import ShareViewSet | ||
from api.pagination import CursorPagination | ||
from api.ingestjobs.serializers import IngestJobSerializer | ||
|
||
|
||
class IngestJobViewSet(ShareViewSet, viewsets.ReadOnlyModelViewSet): | ||
ordering = ('-id', ) | ||
|
||
serializer_class = IngestJobSerializer | ||
pagination_class = CursorPagination | ||
|
||
def get_queryset(self): | ||
return IngestJob.objects.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
-r requirements.txt | ||
|
||
behave==1.2.5 | ||
coveralls==1.2.0 | ||
factory-boy==2.8.1 | ||
fake-factory==0.7.2 | ||
httpretty==0.8.14 | ||
ipdb | ||
ipython | ||
pytest-benchmark==3.0.0 | ||
pytest==3.0.6 | ||
httpretty==0.8.14 | ||
pytest-cov==2.5.1 | ||
coveralls==1.2.0 | ||
pytest==3.0.6 | ||
|
||
# pulling from github because master has django_assert_num_queries context mgr | ||
git+https://github.com/pytest-dev/pytest-django.git@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.