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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 732 Beast Mode
- 55 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive