You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/05/22 14:31:56 UTC

Re: [PR] Docs: add examples for `RuntimeEnv::register_object_store`, improve error messages [datafusion]

alamb commented on code in PR #10617:
URL: https://github.com/apache/datafusion/pull/10617#discussion_r1610105648


##########
datafusion/execution/src/runtime_env.rs:
##########
@@ -89,6 +89,27 @@ impl RuntimeEnv {
     /// scheme, if any.
     ///
     /// See [`ObjectStoreRegistry`] for more details
+    ///
+    /// # Examples
+    ///
+    /// Here's how to set up a local file system object store:
+    /// ```
+    /// let url = Url::try_from("file://").unwrap();
+    /// let object_store = object_store::local::LocalFileSystem::new();
+    /// ctx.runtime_env()
+    ///    .register_object_store(&url, Arc::new(object_store));
+    /// ```
+    ///
+    /// Or how to set up a http object store:
+    /// ```
+    /// let base_url = Url::parse("https://github.com").unwrap();

Review Comment:
   These examples are run automatically via `cargo test --doc` -- so they need to be completely standlone
   
   I took the liberty of pushing a commit to this PR that did so



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org