kedro context and catalog missing from ipython session - ipython

I launched ipython session and trying to load a dataset.
I am running
df = catalog.load("test_dataset")
Facing the below error
NameError: name 'catalog' is not defined
I also tried %reload_kedro but got the below error
UsageError: Line magic function `%reload_kedro` not found.
Even not able to load context either.
I am running the kedro environment from a Docker container.
I am not sure where I am going wrong.

new in 0.17.5 there is a fallback option, please run the following commands in your Jupyter/IPython session:
%load_ext kedro.extras.extensions.ipython
%reload_kedro <path_to_project_root>
This should help you get up and running.

Related

What causes error "Connection test failed: spawn npm; ENOENT" when creating new Strapi project with MongoDB?

I am trying to create a new Strapi app on Ubuntu 16.4 using MongoDB. After stepping through the tutorial, here: https://strapi.io/documentation/3.0.0-beta.x/guides/databases.html#mongodb-installation, I get the following error: Connection test failed: spawn npm; ENOENT
The error seems obvious, but I'm having issues getting to the cause of it. I've installed latest version of MongoDB and have ensured it is running using service mongod status. I can also connect directly using nc, like below.
$ nc -zvv localhost 27017
Connection to localhost 27017 port [tcp/*] succeeded!
Here is an image of the terminal output:
Any help troubleshooting this would be appreciated! Does Strapi perhaps log setup errors somewhere, or is there a way to get verbose logging? Is it possible the connection error would be logged by MongoDB somewhere?
I was able to find the answer. The problem was with using npx instead of Yarn. Strapi documentation states that either should work, however, it is clear from my experience that there is a bug when using npx.
I switched to Yarn and the process proceeded as expected without error. Steps were otherwise exactly the same.
Update: There is also a typo in Strapi documentation for yarn. They include the word "new" before the project name, which will create a project called new and ignore the project name.
Strapi docs (incorrect):
yarn create strapi-app new my-project
Correct usage, based on my experience:
yarn create strapi-app my-project
The ENOENT error is "an abbreviation of Error NO ENTry (or Error NO ENTity), and can actually be used for more than files/directories."
Why does ENOENT mean "No such file or directory"?
Everything I've read on this points toward issues with environment variables and the process.env.PATH.
"NOTE: This error is almost always caused because the command does not exist, because the working directory does not exist, or from a windows-only bug."
How do I debug "Error: spawn ENOENT" on node.js?
If you take the function that Jiaji Zhou provides in the link above and paste it into the top of your config/functions/bootstrap.js file (above module.exports), it might give you a better idea of where the error is occurring, specifically it should tell you the command it ran. Then run the command > which nameOfCommand to see what file path it returns.
"miss-installed programs are the most common cause for a not found command. Refer to each command documentation if needed and install it." - laconbass (from the same link, below Jiaji Zhou's answer)
This is how I interpret all of the above and form a solution. Put that function in bootstrap.js, then take the command returned from the function and run > which nameOfCommand. Then in bootstrap.js (you can comment out the function), put console.log(process.env.PATH) which will return a string of all the directories your current environment is checking for executables. If the path returned from your which command isn't in your process.env.PATH, you can move the command into a path, or try re-installing.

Writing File to a directory using java.io.File.mkdirs() and then accessing it not working in spark cluster mode

When i try to run the same code in client mode, the code runs successfully. But when run on cluster mode it fails to create the file and prompts with error No such File or Directory.
Below is the code sample:
new File("UnexistingLocation").mkdirs()
---> Directories created in client mode
---> Code do not give error in cluster mode but i cannot see directory created. Also while creating File inside the directory gives error No such file or Directory.
Is there a workaround by which i could create files on driver node local filesystem?
due to your error analysis I assume this is run in driver-scoped code. If you submit using --deploy-mode cluster your driver will be started on an arbitrary node which means that's where your directory will be. It won't be on the node where you do your spark-submit from

Executing a terminal command during UI test

While running a UI test in Xcode 8, I would like to run a command (such as ssh into a server) using the NSTask/Process class to verify that the server processed the UI command successfully. However, I get the following error when trying to use the Process/NSTask class:
'Use of unresolved identifier 'Process' (Same error when trying to use NSTask).
Is there any workaround to this? Thank you!

Syntax error on topology.py when I try to run scala command in spark through Cloudera VM

Everytime I try to run following Scala command
val dataRDD = sc.textFile("hdfs://quickstart.cloudera:8020/user/cloudera/data/data.txt")
dataRDD.collect().foreach(println)
//or
dataRDD.count()
I get following exception -
exitCodeException exitCode=1: File "/etc/hadoop/conf.cloudera.yarn/topology.py", line 43 print default_rack^
SyntaxError: Missing parentheses in call to 'print'
-I am running Spark 1.6.0 on Cloudera VM.
Anyone else faced such issue? What can be the reason? I understand that this is due to the 'topology.py' file which is trying to print without "(" which is required on python 3. But Why is this script being excuted when I am not running python/pyspark.
This is only happening through Cloudera VM, when I run outside the vm with some other sample data, the commands work!
I know it might be too late but I am posting the answer any way in case any other user face the same issue.
Above is the known issue and the workaround is following:
Workaround: Add a YARN gateway role to each host that does not already have at least one YARN role (of any type). YARN gateway needs to be added on the node/host where you are facing this issue.

Is there a setting change we need to make for iBatis to MyBatis conversion tool?

Has anyone used the iBatis to MyBatis conversion tool like in https://code.google.com/p/mybatis/wiki/DocUpgrade3? Did you need to make a setting change for the tool to work?
I've tried 2-3 versions of this tool, but I keep getting this error:
[xslt] Loading stylesheet C:\<some-path>\migrate.xslt
[xslt] : Error! Connection timed out: connect
[xslt] : Error! com.sun.org.apache.xml.internal.utils.WrappedRuntimeExcepti
on: Connection timed out: connect
[xslt] Failed to process null
BUILD FAILED
C:\<some-path>\build.xml:2
4: javax.xml.transform.TransformerException: javax.xml.transform.TransformerExce
ption: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Connection
timed out: connect
Also, the way I tried to run it is as follows:
In a command prompt, I changed to the directory where the zip file was extracted. Then I put in one of the SQL map files into the Source folder. Then I went back to the command prompt, and ran the command "ant". I tried this command with 2-3 options too, but none of them worked. All of them gave the same error. It seems like some kind of a proxy setting kind of issue, from what I've found so far. But I don't exactly know what the error is and what the solution is, beyond this. Any idea how to resolve this?
I found a solution to this:
At first, I tried to run the Ant task by setting this property via the command prompt:
set ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
And then ran in the same session: ant
But this continued to give me the same error.
So, I took out the <!DOCTYPE..> line from the source file, and then did the above steps. It worked like magic!