Framework, Pipeline - running code: field steps
See original GitHub issueContinuing on my previous issue 😄 I want to move from step transformation to use pipeline for that. This is a step transformation:
from pprint import pprint
from frictionless import Package, Resource, transform, steps
source = Resource(path="transform.csv")
target = transform(
source,
steps=[steps.field_add(name="Category", type='string', function=lambda rec: 'A' if (rec['BTOT'] in str(list(range(11)))) else 'B'),])
I would like to use Pipeline instead:
from pprint import pprint
from frictionless import Pipeline, transform, steps
pipeline = Pipeline({
'tasks': [
{
'type': 'resource',
'source': {'path': 'transform.csv'},
'steps': [
{'code': 'field_add', 'name': 'Category', 'type':'string', 'function':"lambda rec: 'A' if (rec['BTOT'] in str(list(range(11)))) else 'B')"}
]
}
]
})
status=transform(pipeline)
status
{'version': '4.1.0', 'time': 0.018, 'errors': [], 'tasks': [{'time': False, 'errors': [{'code': 'task-error', 'name': 'Task Error', 'tags': [], 'note': '[step-error] Step is not valid: cannot create check "field_add". Try installing "frictionless-field_add"', 'message': 'The task has an error: [step-error] Step is not valid: cannot create check "field_add". Try installing "frictionless-field_add"', 'description': 'General task-level error.'}], 'type': 'resource', 'target': {}, 'stats': {'errors': 1}, 'valid': False}], 'stats': {'errors': 1, 'tasks': 1}, 'valid': False}
Is it possible to use field steps in Pipeline? Can you elucidate me how to use it?
Please preserve this line to notify @roll (lead of this repository)
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
CI/CD Pipeline: A Gentle Introduction - Semaphore
A CI/CD pipeline helps you automate steps in your software delivery process. Understand the basics, best practices and how to get started.
Read more >CI/CD pipelines - GitLab Docs
Stages, which define when to run the jobs. For example, stages that run tests after stages that compile the code. Jobs are executed...
Read more >Walkthrough: Implementing a pipeline step
Guide to implementing a custom pipeline step in Sitecore Data Exchange Framework in order to create a custom provider.
Read more >Create and run ML pipelines - Azure Machine Learning
Create and run machine learning pipelines to create and manage the workflows that stitch together machine learning (ML) phases.
Read more >How to Implement an Effective CI/CD Pipeline
Understanding how a CI/CD pipeline works is the fundamental step to adopting and implementing an effective framework that enables an organization to release ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve created an issue for it https://github.com/frictionlessdata/frictionless-py/issues/780
@bkarolina It’s just a confusing string representation of pretty healthy data. Internally transform uses this
DataWithErrorHandling
class to handle possible errors with nice error messages showing a step that caused a problem. We just need to rename it to something like ‘data’:<frictionless.transform.resource.DataFromTransform object at 0x7fa0d59b9b80>
Sorry for the confusion 😃