โ02-10-2023 01:22 PM
Hey all, does anyone know how to suppress the output of dbutils.fs.put() ?
โ02-10-2023 09:28 PM
what mean by suppress , can you please share code block
โ02-12-2023 07:22 PM
write dbutils.fs.put('abfs://some_address_to_some_abfs_location_you_have/helloworld.txt','Hello World',True) and notice that it outputs "Wrote X bytes." to the console stdout. I don't want "Wrote X bytes" to be written to the console.
You can suppress dbutils.fs.put()'s output by setting sys.stdout = open("/dev/null","w") and just writing it out somewhere useless, but this doesn't work in a threaded application.
I could suppress the output by getting rid of sys.stdout like above, and then use logging, and write warnings, but I'd rather not have a warning written as I'm using warnings and errors for other purposes.
โ02-12-2023 11:14 PM
Hi @Jordan Foxโ
Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!
โ02-13-2023 09:32 PM
No, have not resolved the issue. Still Wrote 105783245 bytes. If dbutils.fs.put(), which is:
put(file: String, contents: String, overwrite: boolean = false): boolean -> Writes the given String out to a file, encoded in UTF-8
Could instead be:
put(file: String, contents: String, overwrite: boolean = false, verbose: boolean = true): boolean -> Writes the given String out to a file, encoded in UTF-8, defaults message to stdout unless verbose=false
That would be great.
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