You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "BipulLamsal (via GitHub)" <gi...@apache.org> on 2025/11/21 11:01:52 UTC

[PR] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

BipulLamsal opened a new pull request, #18869:
URL: https://github.com/apache/datafusion/pull/18869

   ## Which issue does this PR close?
   
   
   - Closes #18844
   
   
   ## What changes are included in this PR?
   Instead of using `data_type_and_nullable`, this patch removes the indirection and calls `to_field` directly. The deprecated helper added no additional logic, so the PR encourages callers to use the field returned by to_field to access both the data type and the nullability.
   
   
   ## Are these changes tested?
   Yes
   
   
   
   


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "codetyri0n (via GitHub)" <gi...@apache.org>.
codetyri0n commented on PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#issuecomment-3564291086

    run this script and fix the resulting clippy errors - ci/scripts/rust_clippy.sh 


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#issuecomment-3575376021

   - I also filed a ticket to give the same treatment to `metadata`: https://github.com/apache/datafusion/issues/18930


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

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


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#issuecomment-3597296662

   Thanks again @BipulLamsal @codetyri0n  and @comphead 


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "codetyri0n (via GitHub)" <gi...@apache.org>.
codetyri0n commented on PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#issuecomment-3570949605

   if this is a wider CI issue as mentioned on discord - changes look good to me @alamb 


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#issuecomment-3575377000

   Thank you @BipulLamsal 


-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#discussion_r2559764840


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -58,6 +58,10 @@ pub trait ExprSchemable {
     fn cast_to(self, cast_to_type: &DataType, schema: &dyn ExprSchema) -> Result<Expr>;
 
     /// Given a schema, return the type and nullability of the expr
+    #[deprecated(
+        since = "51.0.0",
+        note = "Use `to_field().1.is_nullable` and `to_field().1.data_type()` directly instead"

Review Comment:
   Yeah it is unfortunate that `to_feld` returns a relation and a field tuple rather than a struct



-- 
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] fix: deprecate data_type_and_nullable and simplify API usage [datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #18869:
URL: https://github.com/apache/datafusion/pull/18869#discussion_r2558347202


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -58,6 +58,10 @@ pub trait ExprSchemable {
     fn cast_to(self, cast_to_type: &DataType, schema: &dyn ExprSchema) -> Result<Expr>;
 
     /// Given a schema, return the type and nullability of the expr
+    #[deprecated(
+        since = "51.0.0",
+        note = "Use `to_field().1.is_nullable` and `to_field().1.data_type()` directly instead"

Review Comment:
   probably we can name params in future to get more meaning for  `to_field().1`



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