nuno-faria commented on code in PR #1311:
URL:
https://github.com/apache/datafusion-python/pull/1311#discussion_r2559656751
##########
python/tests/test_functions.py:
##########
@@ -766,7 +766,7 @@ def test_array_function_obj_tests(stmt, py_expr):
),
(
f.regexp_replace(column("a"), literal("(ell|orl)"), literal("-")),
- pa.array(["H-o", "W-d", "!"]),
+ pa.array(["H-o", "W-d", "!"], type=pa.string_view()),
Review Comment:
`regexp_replace` now uses `UTF8View`:
https://github.com/apache/datafusion/pull/17195
##########
python/tests/test_expr.py:
##########
@@ -895,10 +895,10 @@ def test_alias_with_metadata(df):
col("d").arrow_typeof(),
pa.array(
[
- 'List(Field { name: "item", data_type: Int64, nullable:
true, dict_id: 0, dict_is_ordered: false, metadata: {} })', # noqa: E501
- 'List(Field { name: "item", data_type: Int64, nullable:
true, dict_id: 0, dict_is_ordered: false, metadata: {} })', # noqa: E501
- 'List(Field { name: "item", data_type: Int64, nullable:
true, dict_id: 0, dict_is_ordered: false, metadata: {} })', # noqa: E501
- 'List(Field { name: "item", data_type: Int64, nullable:
true, dict_id: 0, dict_is_ordered: false, metadata: {} })', # noqa: E501
+ "List(nullable Int64)",
+ "List(nullable Int64)",
+ "List(nullable Int64)",
+ "List(nullable Int64)",
Review Comment:
Lists have a new render format: https://github.com/apache/arrow-rs/pull/8290
##########
src/expr/statement.rs:
##########
@@ -337,16 +340,13 @@ impl LogicalNode for PyPrepare {
#[pymethods]
impl PyPrepare {
#[new]
- pub fn new(name: String, data_types: Vec<PyDataType>, input:
PyLogicalPlan) -> Self {
+ pub fn new(name: String, fields: Vec<PyArrowType<Field>>, input:
PyLogicalPlan) -> Self {
Review Comment:
`Prepare` now stores fields: https://github.com/apache/datafusion/pull/17986
##########
src/catalog.rs:
##########
@@ -63,7 +63,7 @@ impl From<Arc<dyn SchemaProvider>> for PySchema {
#[pymethods]
impl PyCatalog {
#[new]
- fn new(catalog: PyObject) -> Self {
+ fn new(catalog: Py<PyAny>) -> Self {
Review Comment:
`PyObject` has been deprecated:
https://pyo3.rs/main/migration.html#deprecation-of-pyobject-type-alias
##########
src/dataframe.rs:
##########
@@ -1042,7 +1046,7 @@ impl PyDataFrame {
let df = self.df.as_ref().clone();
let streams = spawn_future(py, async move {
df.execute_stream_partitioned().await })?;
- let mut schema: Schema = self.df.schema().to_owned().into();
+ let mut schema: Schema =
self.df.schema().to_owned().as_arrow().clone();
Review Comment:
https://github.com/apache/datafusion/pull/17643
##########
src/expr/create_external_table.rs:
##########
@@ -67,14 +67,15 @@ impl Display for PyCreateExternalTable {
impl PyCreateExternalTable {
#[allow(clippy::too_many_arguments)]
#[new]
- #[pyo3(signature = (schema, name, location, file_type,
table_partition_cols, if_not_exists, temporary, order_exprs, unbounded,
options, constraints, column_defaults, definition=None))]
+ #[pyo3(signature = (schema, name, location, file_type,
table_partition_cols, if_not_exists, or_replace, temporary, order_exprs,
unbounded, options, constraints, column_defaults, definition=None))]
Review Comment:
https://github.com/apache/datafusion/pull/17580
##########
src/catalog.rs:
##########
@@ -81,15 +81,15 @@ impl PyCatalog {
}
#[pyo3(signature = (name="public"))]
- fn schema(&self, name: &str) -> PyResult<PyObject> {
+ fn schema(&self, name: &str) -> PyResult<Py<PyAny>> {
let schema = self
.catalog
.schema(name)
.ok_or(PyKeyError::new_err(format!(
"Schema with name {name} doesn't exist."
)))?;
- Python::with_gil(|py| {
+ Python::attach(|py| {
Review Comment:
https://pyo3.rs/main/migration.html#rename-of-pythonwith_gil-pythonallow_threads-and-pyo3prepare_freethreaded_python
##########
src/functions.rs:
##########
@@ -21,8 +21,9 @@ use datafusion::common::{Column, ScalarValue, TableReference};
use datafusion::execution::FunctionRegistry;
use datafusion::functions_aggregate::all_default_aggregate_functions;
use datafusion::functions_window::all_default_window_functions;
-use datafusion::logical_expr::expr::{Alias, FieldMetadata, WindowFunction,
WindowFunctionParams};
-use datafusion::logical_expr::sqlparser::ast::NullTreatment as DFNullTreatment;
Review Comment:
`NullTreatment` has been moved to not rely on the `sqlparser`:
https://github.com/apache/datafusion/pull/17332
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]