Skip to content

Remove the deprecated XGDMatrixCreateFromFile.#12297

Merged
trivialfis merged 3 commits into
dmlc:masterfrom
trivialfis:drop-ctor-from-file
Jul 10, 2026
Merged

Remove the deprecated XGDMatrixCreateFromFile.#12297
trivialfis merged 3 commits into
dmlc:masterfrom
trivialfis:drop-ctor-from-file

Conversation

@trivialfis

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated C API entry point XGDMatrixCreateFromFile and updates internal bindings, tests, and documentation to use the JSON-config-based XGDMatrixCreateFromURI API instead.

Changes:

  • Remove XGDMatrixCreateFromFile from the public C header and C API implementation.
  • Update C++ C-API tests and user-facing docs/tutorial/demo to construct and pass URI JSON configs to XGDMatrixCreateFromURI.
  • Update XGBoost4J JNI + Java wrappers/tests to call XGDMatrixCreateFromURI (with JNI constructing the JSON config).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/cpp/c_api/test_c_api.cc Drops deprecated API coverage and consolidates error-handling test to the URI path.
src/c_api/c_api.cc Removes the deprecated XGDMatrixCreateFromFile C API shim implementation.
include/xgboost/c_api.h Removes the deprecated XGDMatrixCreateFromFile declaration/docs from the public header.
doc/tutorials/c_api_tutorial.rst Updates tutorial examples to use JSON config + XGDMatrixCreateFromURI.
demo/c-api/basic/c-api-demo.c Updates demo to build a JSON config string and call XGDMatrixCreateFromURI.
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoostJNI.java Renames native entry point to XGDMatrixCreateFromURI.
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/DMatrix.java Switches Java constructor to call the renamed native method.
jvm-packages/xgboost4j/src/native/xgboost4j.h Renames the JNI function declaration for the DMatrix create call.
jvm-packages/xgboost4j/src/native/xgboost4j.cpp Implements JNI wrapper that builds JSON config and calls XGDMatrixCreateFromURI.
jvm-packages/xgboost4j/src/test/java/ml/dmlc/xgboost4j/java/DMatrixTest.java Renames the test to reflect URI-based creation.
Files not reviewed (1)
  • jvm-packages/xgboost4j/src/native/xgboost4j.h: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +39 to +43
static void MakeDMatrixConfig(char const* uri, int silent, size_t length, char* out) {
static char const kTemplate[] = "{\"uri\": \"%s\", \"silent\": %d}";
memset(out, '\0', length);
snprintf(out, length, kTemplate, uri, silent);
}
@trivialfis trivialfis merged commit 5b0ba2f into dmlc:master Jul 10, 2026
80 of 81 checks passed
@trivialfis trivialfis deleted the drop-ctor-from-file branch July 10, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants