There is something strange on Easymorph.
I have a project with some data transformation that exports some CSV files and then I have a Powershell command to upload those files to BigQuery. Something like this:
So… very easy: import data → transform → export CSV → upload those CSV using Powershell.
The problem is this: It works perfectly if I open the project and click on “reload and run”. But if I schedule it or run it with Easymorph Launcher… it won’t. It stops on the CSV export, but never uploads the data to BigQuery using Powershell.
It’s hard to say what may cause such behavior. EasyMorph Desktop and Launcher are very similar from a technical standpoint. Both are Windows Desktop applications, have the same set of permissions, use exactly the same calculation engine, and run under the same Windows account (I assume you use them both on the same computer).
Make sure that the CSV file is not open in a text editor, and there is nothing else that may block accessing it.
To use bq you don’t need PowerShell. You can run it with the “Run program action”.
Also, bq is Python-based. Python requires several system variables configured. Maybe something is off in this regard. E.g. working directory is not specified or something else.
Is definitely something off with Windows. I tried with CMD to run bq, but I just got some errors.
But I just found a workaround!
1. Create a .ps1 file with the Powershell script.
2. Create a new task in Windows Task Scheduler.
3. Run Powershell with this action: powershell -executionpolicy bypass -File ‘C:\Users\analitica\Documents\my_script_file.ps1’
4. Run program in EasyMorph: C:\Windows\System32\schtasks.exe
And add this argument: /RUN /TN “The name of the task”
With this it works perfectly. Yes… maybe this is not the ideal solution. But it works without a big trouble. Can be useful to someone else.
I’m going to try again following your instructions and run bq with “Run program action”… for science
Thanks for your help!!
UPDATE: Running bq with the “Run program action” didn’t work either. It has the same problem: works in the editor but not in the launcher. I’m very sure this is about a security setting in this Windows install, I don’t know how to fix that. So, this workaround will be the best (not ideal) solution at the moment.