Skip to content

[SPARK-52010] Do not generate API docs for internal classes #50797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

While reviewing the API doc of 4.0 RC4, I found that there are some newly added internal classes appear in the API doc. This PR fixes them.

Why are the changes needed?

API doc should not include internal classes

Does this PR introduce any user-facing change?

no

How was this patch tested?

N/A

Was this patch authored or co-authored using generative AI tooling?

no

@@ -16,11 +16,11 @@
*/
package org.apache.spark.util

trait SparkStringUtils {
private[spark] trait SparkStringUtils {
Copy link
Contributor Author

@cloud-fan cloud-fan May 6, 2025

Choose a reason for hiding this comment

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

added in #49062

@@ -25,7 +25,7 @@ import javax.tools.{JavaFileObject, SimpleJavaFileObject, ToolProvider}

import scala.jdk.CollectionConverters._

trait SparkTestUtils {
private[spark] trait SparkTestUtils {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in #43354

@@ -30,7 +30,7 @@ import org.apache.spark.sql.catalyst.util.{FailFastMode, ParseMode, PermissiveMo
import org.apache.spark.sql.errors.QueryCompilationErrors
import org.apache.spark.sql.types._

private[sql] case class AvroDataToCatalyst(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

4.0 added two new internal classes in this package: AvroExpressionEvalUtils, AvroCompressionCodec. Given that this package contains only internal classes and deprecated APIs since 3.0, I marked the entire org.apache.spark.sql.avro package as private, so that we no longer need private[sql] in these existing classes.

"org.apache.spark.sql.scripting"
"org.apache.spark.kafka010",
"org.apache.spark.network",
"org.apache.spark.sql.avro",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -30,7 +30,7 @@ import org.apache.spark.internal.Logging
/**
* Class to conveniently update Kafka config params, while logging the changes
*/
private[spark] case class KafkaConfigUpdater(module: String, kafkaParams: Map[String, Object])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

4.0 added one new internal class in this package: KafkaTokenProviderExceptions. Given that this package contains only internal classes, I marked the entire org.apache.spark.kafka010 package as private, so that we no longer need private[spark] in these existing classes.

"org.apache.spark.deploy",
"org.apache.spark.util.collection",
"org.apache.spark.sql.scripting"
"org.apache.spark.kafka010",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

"org.apache.spark.network",
"org.apache.spark.sql.avro",
"org.apache.spark.sql.scripting",
"org.apache.spark.types.variant",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new variant project adds this new package, but it only contain internal classes.

"org.apache.spark.sql.avro",
"org.apache.spark.sql.scripting",
"org.apache.spark.types.variant",
"org.apache.spark.ui.flamegraph",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added by #42988 , should be intrenal

@@ -23,7 +23,7 @@ import org.apache.spark.{SparkThrowable, SparkThrowableHelper}
import org.apache.spark.sql.catalyst.trees.Origin
import org.apache.spark.sql.exceptions.SqlScriptingException.errorMessageWithLineNumber

class SqlScriptingException (
private[sql] class SqlScriptingException (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added by the new scripting feature.

@@ -871,7 +871,7 @@ abstract class JdbcDialect extends Serializable with Logging {
/**
* Make the `classifyException` method throw out the original exception
*/
trait NoLegacyJDBCError extends JdbcDialect {
private[sql] trait NoLegacyJDBCError extends JdbcDialect {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added by #46937

@cloud-fan cloud-fan changed the title [SPARK-52010] Do not generate API docs for private classes [SPARK-52010] Do not generate API docs for internal classes May 6, 2025
@cloud-fan
Copy link
Contributor Author

cc @HyukjinKwon @dongjoon-hyun @yaooqinn @hvanhovell

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, it looks good to me. Thank you, @cloud-fan .

@yaooqinn yaooqinn closed this in 9f5ae88 May 6, 2025
yaooqinn pushed a commit that referenced this pull request May 6, 2025
### What changes were proposed in this pull request?

While reviewing the API doc of 4.0 RC4, I found that there are some newly added internal classes appear in the API doc. This PR fixes them.

### Why are the changes needed?

API doc should not include internal classes

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

### Was this patch authored or co-authored using generative AI tooling?

no

Closes #50797 from cloud-fan/api.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Kent Yao <yao@apache.org>
(cherry picked from commit 9f5ae88)
Signed-off-by: Kent Yao <yao@apache.org>
@yaooqinn
Copy link
Member

yaooqinn commented May 6, 2025

Merged to master/4.0, thank you @cloud-fan @dongjoon-hyun

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

LGTM2

cloud-fan added a commit that referenced this pull request May 29, 2025
### What changes were proposed in this pull request?

This is a followup of #50797 , to exclde these private packages from mima check.

### Why are the changes needed?

mima shouldn't check private APIs

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

### Was this patch authored or co-authored using generative AI tooling?

no

Closes #51038 from cloud-fan/mima.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan added a commit that referenced this pull request May 29, 2025
### What changes were proposed in this pull request?

This is a followup of #50797 , to exclde these private packages from mima check.

### Why are the changes needed?

mima shouldn't check private APIs

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

### Was this patch authored or co-authored using generative AI tooling?

no

Closes #51038 from cloud-fan/mima.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit f634311)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants