Is there a reliable way to make Magic ETL intentionally fail?
I have an ETL that uses, among other inputs, a Webform that isn't always maintained perfectly. One recent problem involved two rows for the same identifier, with different text in the description column.
What I'd like to do is make the ETL fail if something like this happens. I tried doing a Group By on the identifier column, count the values, then filtered for counts greater than 1, and then tried to force an error by dividing by 0, but this results in "infinity". Similarly, SQRT() of a negative number produces "NaN", but no error.
I know there's potentially other approaches to this problem, such as creating an ETL that does validation across multiple datasets, then set up an alert based on certain outputs, but in the meantime, alerts won't prevent the ETL from producing incorrect results. I'd like the ETL to stop until the problem is fixed.
Best Answer
-
You can use the
ERROR
function to cause the dataflow to error out with a specific message in a formula tile.CASE WHEN `Number` < 0 THEN ERROR('Number is negative') END
The one caveat to this is that you have to save the ETL immediately after you enter this formula otherwise if it attempts to validate your ETL it won't allow you to save the ETL so if you need to make future changes you may need to remove the ERROR function, make the changes you need then add the ERROR function back and immediately save the ETL.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**6
Answers
-
You can use the
ERROR
function to cause the dataflow to error out with a specific message in a formula tile.CASE WHEN `Number` < 0 THEN ERROR('Number is negative') END
The one caveat to this is that you have to save the ETL immediately after you enter this formula otherwise if it attempts to validate your ETL it won't allow you to save the ETL so if you need to make future changes you may need to remove the ERROR function, make the changes you need then add the ERROR function back and immediately save the ETL.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**6 -
That's excellent, thanks! I guess I didn't use the right search terms, but I was trying to search for etl, error, etc. and didn't find anything.
Even better, my next question was going to be how I can fail with a meaningful message.
0 -
It's not a very well documented feature, I just happened to stumble across it when attempting to come up with a solution for you. If you could accept the answer so others will find it I'd appreciate it.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive