You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "timsaucer (via GitHub)" <gi...@apache.org> on 2026/04/07 18:57:46 UTC

[PR] minor: remove deprecated interfaces [datafusion-python]

timsaucer opened a new pull request, #1481:
URL: https://github.com/apache/datafusion-python/pull/1481

   # Which issue does this PR close?
   
   None
   
    # Rationale for this change
   
   We have a bunch of stale interfaces, some that have been marked as deprecated for over 10 releases. This removes any that have been deprecated for >3.
   
   # What changes are included in this PR?
   
   Remove deprecated interfaces.
   
   # Are there any user-facing changes?
   
   Yes, these old interfaces are no longer available.


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


Re: [PR] minor: remove deprecated interfaces [datafusion-python]

Posted by "nuno-faria (via GitHub)" <gi...@apache.org>.
nuno-faria commented on code in PR #1481:
URL: https://github.com/apache/datafusion-python/pull/1481#discussion_r3053916394


##########
python/datafusion/dataframe_formatter.py:
##########
@@ -748,7 +748,7 @@ def get_formatter() -> DataFrameHtmlFormatter:
         The global HTML formatter instance
 
     Example:
-        >>> from datafusion.html_formatter import get_formatter
+        >>> from datafusion.dataframe_formatter import get_formatter
         >>> formatter = get_formatter()
         >>> formatter.max_cell_length = 50  # Increase cell length
     """

Review Comment:
   Here is the referenced page: https://datafusion.apache.org/python/user-guide/dataframe/rendering.html



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


Re: [PR] minor: remove deprecated interfaces [datafusion-python]

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


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


Re: [PR] minor: remove deprecated interfaces [datafusion-python]

Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer commented on code in PR #1481:
URL: https://github.com/apache/datafusion-python/pull/1481#discussion_r3054078779


##########
docs/source/user-guide/common-operations/windows.rst:
##########
@@ -189,10 +186,14 @@ power in its ``"Type 1"`` using the :py:func:`datafusion.functions.avg` function
         col('"Name"'),
         col('"Attack"'),
         col('"Type 1"'),
-        f.window("avg", [col('"Attack"')])
-            .partition_by(col('"Type 1"'))
-            .build()
-            .alias("Average Attack"),
+        f.avg(col('"Attack"')).over(
+            Window(
+                window_frame=WindowFrame("rows", None, None),
+                partition_by=[col('"Type 1"')],
+                order_by=[col('"Speed"')],
+                null_treatment=NullTreatment.IGNORE_NULLS,
+            )
+        ).alias("Average Attack"),

Review Comment:
   The window_frame is necessary so that we get the same avg across the entire partition. Otherwise we'd need a sort on it afterwards to make sure it shows up in the "running avg" and I think using the frame is more easy to understand. But you're right about the null treatment and order_by.



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


Re: [PR] minor: remove deprecated interfaces [datafusion-python]

Posted by "nuno-faria (via GitHub)" <gi...@apache.org>.
nuno-faria commented on code in PR #1481:
URL: https://github.com/apache/datafusion-python/pull/1481#discussion_r3053901629


##########
docs/source/user-guide/common-operations/windows.rst:
##########
@@ -189,10 +186,14 @@ power in its ``"Type 1"`` using the :py:func:`datafusion.functions.avg` function
         col('"Name"'),
         col('"Attack"'),
         col('"Type 1"'),
-        f.window("avg", [col('"Attack"')])
-            .partition_by(col('"Type 1"'))
-            .build()
-            .alias("Average Attack"),
+        f.avg(col('"Attack"')).over(
+            Window(
+                window_frame=WindowFrame("rows", None, None),
+                partition_by=[col('"Type 1"')],
+                order_by=[col('"Speed"')],
+                null_treatment=NullTreatment.IGNORE_NULLS,
+            )
+        ).alias("Average Attack"),

Review Comment:
   I don't think the `order_by`, `window_frame`, or `null_treatment` make sense here.



##########
crates/core/src/dataframe.rs:
##########
@@ -554,13 +554,6 @@ impl PyDataFrame {
         Ok(PyTable::from(table_provider))
     }
 
-    #[pyo3(signature = (*args))]
-    fn select_columns(&self, args: Vec<PyBackedStr>) -> PyDataFusionResult<Self> {
-        let args = args.iter().map(|s| s.as_ref()).collect::<Vec<&str>>();
-        let df = self.df.as_ref().clone().select_columns(&args)?;
-        Ok(Self::new(df))
-    }
-

Review Comment:
   Strange that this is deprecated in `datafusion-python` but not in `datafusion`: https://docs.rs/datafusion/53.0.0/datafusion/dataframe/struct.DataFrame.html#method.select_columns



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


Re: [PR] minor: remove deprecated interfaces [datafusion-python]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1481:
URL: https://github.com/apache/datafusion-python/pull/1481#discussion_r3053091547


##########
python/datafusion/dataframe_formatter.py:
##########
@@ -748,7 +748,7 @@ def get_formatter() -> DataFrameHtmlFormatter:
         The global HTML formatter instance
 
     Example:
-        >>> from datafusion.html_formatter import get_formatter
+        >>> from datafusion.dataframe_formatter import get_formatter
         >>> formatter = get_formatter()
         >>> formatter.max_cell_length = 50  # Increase cell length
     """

Review Comment:
   The docs still reference the removed `datafusion.html_formatter` module (e.g. `docs/source/user-guide/dataframe/rendering.rst`), but this PR deletes `python/datafusion/html_formatter.py`. Update those documentation imports/usages to `datafusion.dataframe_formatter` (or keep a small compatibility shim) to avoid broken docs/examples.



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


Re: [PR] minor: remove deprecated interfaces [datafusion-python]

Posted by "timsaucer (via GitHub)" <gi...@apache.org>.
timsaucer commented on code in PR #1481:
URL: https://github.com/apache/datafusion-python/pull/1481#discussion_r3054073039


##########
crates/core/src/dataframe.rs:
##########
@@ -554,13 +554,6 @@ impl PyDataFrame {
         Ok(PyTable::from(table_provider))
     }
 
-    #[pyo3(signature = (*args))]
-    fn select_columns(&self, args: Vec<PyBackedStr>) -> PyDataFusionResult<Self> {
-        let args = args.iter().map(|s| s.as_ref()).collect::<Vec<&str>>();
-        let df = self.df.as_ref().clone().select_columns(&args)?;
-        Ok(Self::new(df))
-    }
-

Review Comment:
   Because we can take both arguments in select vs select_columns, we deprecated select_columns a long time ago because it's more pythonic to have just one interface.



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