โ06-07-2022 12:47 AM
I try to upload the needed files under the right directory of the project to work.
The files are zipped first as that is an accepted format.
I have a Python project which requires the TXT and CSV format files as they are called and used via .py files to execute the functions from the notebook.
The error I am met with is Import failed with error: Could not deserialize: Unknown language: "txt" culture
Any idea regarding txt and csv upload capabilities in the Databricks Workspace?
This would be greatly appreciated.
Kind Regards,
Shay
โ06-07-2022 03:49 AM
These are the only formats allowed AFAIK.
You do have to change you project indeed. But as long as you do not move the files around that should only be a small change.
The reason it is like that is because the source data (aka 'the files') can be used in several projects, the project is not the owner of the data.
What you could try is to package everything in a wheel or something similar.
I do a similar thing with configuration files in a jar.
โ06-07-2022 01:04 AM
@Shay Alamโ, can you share the code with which you read the files? Apparently python interprets the file format as a language, so it seems like some options are not filled in correctly.
โ06-07-2022 01:22 AM
Hi @Werner Stinckensโ, so the UI is used to upload the files in a zip format, by going to the right part of the directory of the Python project and then selecting import, no particular code is used to upload them, or do you mean the python project code?
Thank You
โ06-07-2022 02:13 AM
@Shay Alamโ, I mean the python project code.
I assume the upload itself was successful
โ06-07-2022 03:30 AM
@Werner Stinckensโ Hi, sorry for the confusion, the upload itself is the issue, the files and project work fine inside the Repo section, but when uploading the project files into the shared workspace, the .py files and notebook are there, but the txt or csv files do not upload into the shared workspace.
โ06-07-2022 03:33 AM
@Shay Alamโ
Ok I see ๐
Files with .zip extension must only contain folders, HTML files, or source files (Python, Scala, SQL, R). So txt and csv do not work. You can store those in the FileStore or external storage (blob, ...)
โ06-07-2022 03:39 AM
Ok, understood and appreciate this, is there any other way to upload them into the shared workspace or is is just that these are the only formats allowed?
Additionally if I upload those files to FileStore or elsewhere I assume the project will need to be changed to look for them outside the directory?
I was trying to keep these files within the structure of the project for just general convenience of having the project in one place with necessary files and directories inside.
Thank you ๐
โ06-07-2022 03:49 AM
These are the only formats allowed AFAIK.
You do have to change you project indeed. But as long as you do not move the files around that should only be a small change.
The reason it is like that is because the source data (aka 'the files') can be used in several projects, the project is not the owner of the data.
What you could try is to package everything in a wheel or something similar.
I do a similar thing with configuration files in a jar.
โ06-08-2022 05:38 AM
Thank you very much for your insight on this, will try a workaround
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group