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

Processing node for preview datasets #22

Closed
6 tasks done
zelima opened this issue Sep 19, 2017 · 1 comment · Fixed by #24
Closed
6 tasks done

Processing node for preview datasets #22

zelima opened this issue Sep 19, 2017 · 1 comment · Fixed by #24
Assignees

Comments

@zelima
Copy link
Collaborator

zelima commented Sep 19, 2017

We need new processing node to define one more processing flow (preview datasets). For that, we need to implement a class inheriting from BaseProcessingNode, and add that class name to the ORDERED_NODE_CLASSES array. new processing node will iterate over all resources and add processors that are generating first 10000 rows and views to the ones that have type derived/json

Acceptance criteria

Tasks

  • define new class for preview processing node class DerivedPreviewProcessingNode that will inherit DerivedFormatProcessingNode
  • in the DerivedPreviewProcessingNode override get_artifacts and Iterate over existing artefacts (resources)
  • check for the ones that are derived/json (or csv?)
  • and pass the processors that we will need to get the desired resources and views.
  • add DerivedPreviewProcessingNode to the ORDERED_NODE_CLASSES in correct position (last in the list)

Analysis

Example how refactored basic_nodes.py may look like

class DerivedFormatProcessingNode(BaseProcessingNode):

  def get_artifacts(self):
    for artifact in self.available_artifacts:
      if artifact.datahub_type == 'derived/csv':
        datahub_type = 'derived/preview' 
        resource_name = artifact.resource_name + '_preview.'
        output = ProcessingArtifact(
        datahub_type, resource_name,
        [artifact], [],
        [(new processors + old goes here)],
                True
            )
            yield output

class DerivedPreviewProcessingNode(...):
  def __init__(self):
    ... # (all same)
@zelima zelima added this to the Sprint - 25 Sep 2017 milestone Sep 19, 2017
@zelima zelima self-assigned this Sep 19, 2017
@zelima zelima mentioned this issue Sep 19, 2017
7 tasks
zelima added a commit that referenced this issue Sep 21, 2017
[data preview][l]: Processing preview resources

* two new processors for getting first N rows and updating descriptor with views
* load modified resources handles with views
* Bug fix re dependency names (see commit message)
* New processing node for previews dependent on `derived/csv`

closes #22 #23 
refs #16
@zelima
Copy link
Collaborator Author

zelima commented Sep 21, 2017

FIXED

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 a pull request may close this issue.

1 participant