You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jdye64 (via GitHub)" <gi...@apache.org> on 2023/03/07 17:27:17 UTC

[GitHub] [arrow-datafusion-python] jdye64 commented on a diff in pull request #260: feature: Set table name from ctx functions

jdye64 commented on code in PR #260:
URL: https://github.com/apache/arrow-datafusion-python/pull/260#discussion_r1128267838


##########
src/context.rs:
##########
@@ -276,23 +276,29 @@ impl PySessionContext {
     fn create_dataframe(
         &mut self,
         partitions: PyArrowType<Vec<Vec<RecordBatch>>>,
+        name: Option<&str>,
         py: Python,
     ) -> PyResult<PyDataFrame> {
         let schema = partitions.0[0][0].schema();
         let table = MemTable::try_new(schema, partitions.0).map_err(DataFusionError::from)?;
 
-        // generate a random (unique) name for this table
+        // generate a random (unique) name for this table if none is provided
         // table name cannot start with numeric digit
-        let name = "c".to_owned()
-            + Uuid::new_v4()
-                .simple()
-                .encode_lower(&mut Uuid::encode_buffer());
+        let table_name = match name {
+            Some(val) => val.to_owned(),

Review Comment:
   nice!



-- 
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@arrow.apache.org

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