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

[GitHub] [arrow-datafusion-python] simicd opened a new pull request, #260: feature: Set table name from ctx functions

simicd opened a new pull request, #260:
URL: https://github.com/apache/arrow-datafusion-python/pull/260

   # Which issue does this PR close?
   Closes #259 
   
    # Rationale for this change
   Possibility to set table name when constructing dataframe from Arrow table/Python dictionary/pandas/polars
   
   # What changes are included in this PR?
   See above
   
   # Are there any user-facing changes?
   Optional `name` parameter in `create_dataframe` and `from_` functions
   


-- 
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


[GitHub] [arrow-datafusion-python] andygrove merged pull request #260: feature: Set table name from ctx functions

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove merged PR #260:
URL: https://github.com/apache/arrow-datafusion-python/pull/260


-- 
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


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

Posted by "jdye64 (via GitHub)" <gi...@apache.org>.
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