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

[GitHub] [arrow-datafusion] WenyXu opened a new pull request, #5926: test: add infer schema with limit test for csv

WenyXu opened a new pull request, #5926:
URL: https://github.com/apache/arrow-datafusion/pull/5926

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Add infer schema with limit test for `CsvFormat`
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
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] WenyXu commented on pull request #5926: test: add infer schema with limit test for csv

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

   > Thank you for the contribution @WenyXu
   > 
   > I am sorry I don't totally get the reason for adding this test. Perhaps I am missing something
   
   Oh, My mistake, I didn’t see the part of 'Some(1)'. I'm going to close this PR


-- 
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] WenyXu closed pull request #5926: test: add infer schema with limit test for csv

Posted by "WenyXu (via GitHub)" <gi...@apache.org>.
WenyXu closed pull request #5926: test: add infer schema with limit test for csv
URL: https://github.com/apache/arrow-datafusion/pull/5926


-- 
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] alamb commented on a diff in pull request #5926: test: add infer schema with limit test for csv

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


##########
datafusion/core/src/datasource/file_format/csv.rs:
##########
@@ -385,6 +387,46 @@ mod tests {
         Ok(())
     }
 
+    #[tokio::test]
+    async fn infer_shcmea_with_limit() {
+        let session = SessionContext::new();
+        let ctx = session.state();
+        let store = Arc::new(LocalFileSystem::new()) as _;
+        let filename = "tests/csv/schema_infer_limit.csv";
+        let format = CsvFormat::default().with_schema_infer_max_rec(Some(3));
+
+        let file_schema = format
+            .infer_schema(&ctx, &store, &[local_unpartitioned_file(filename)])
+            .await
+            .expect("Schema inference");

Review Comment:
   Can you explain why you chose to add this test? I think this feature is already covered by existing tests.
   
   I see the test `infer_schema` above this that has a limit of `Some(1)`.
   
   Which should call infer schema as part of its execution. 



##########
datafusion/core/src/datasource/file_format/csv.rs:
##########
@@ -385,6 +387,46 @@ mod tests {
         Ok(())
     }
 
+    #[tokio::test]
+    async fn infer_shcmea_with_limit() {

Review Comment:
   ```suggestion
       async fn infer_schema_with_limit() {
   ```



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